public class MimeType extends Object
| Modifier and Type | Field and Description |
|---|---|
static MimeType |
MIME_APPLICATION_JSON |
static MimeType |
MIME_APPLICATION_XML |
static MimeType |
MIME_IMAGE |
static MimeType |
MIME_IMAGE_JPEG |
static MimeType |
MIME_IMAGE_PNG |
static MimeType |
MIME_IMAGE_TIF |
static MimeType |
MIME_WILDCARD
Convenience definitions for commonly used MIME types
|
| Modifier and Type | Method and Description |
|---|---|
static MimeType |
fromExtension(String ext)
Determine MIME type for the given file extension
|
static MimeType |
fromFilename(String filename)
Determine MIME type from filename string.
|
static MimeType |
fromTypename(String typeName)
Given an existing MIME type name, look up the corresponding instance.
|
static MimeType |
fromURI(URI uri)
Determine MIME type from URI.
|
List<String> |
getExtensions()
Get the known file extensions for the MIME type
|
String |
getPrimaryType() |
String |
getSubType() |
String |
getSuffix() |
String |
getTypeName()
Get the MIME type's name (e.g.
|
boolean |
matches(Object other)
Check if the MIME type "matches" another MIME type.
|
public static final MimeType MIME_WILDCARD
public static final MimeType MIME_IMAGE
public static final MimeType MIME_APPLICATION_JSON
public static final MimeType MIME_APPLICATION_XML
public static final MimeType MIME_IMAGE_JPEG
public static final MimeType MIME_IMAGE_TIF
public static final MimeType MIME_IMAGE_PNG
public static MimeType fromExtension(String ext)
public static MimeType fromFilename(String filename)
public static MimeType fromTypename(String typeName)
public String getTypeName()
public String getPrimaryType()
public String getSubType()
public String getSuffix()
public boolean matches(Object other)
other - Other MIME type to compare againstCopyright © 2018. All rights reserved.