public class MimeTypes extends Object
MimeTypes contains a mapping from extensions to mime types.| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_OCTET_STREAM
constant for "application/octet-stream"
|
| Constructor and Description |
|---|
MimeTypes() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getExtension(String mimeType)
Retrieve the default extension for the given mime type
|
static String |
getMimeType(String name)
Retrieve the mimetype for the given extension or name
|
static String |
getMimeType(String name,
String defaultType)
Retrieve the mimetype for the given extension or name
|
static boolean |
hasExtension(String mimeType,
String ext)
Checks if the given mime type is mapped to the extension
|
static boolean |
isBinary(String mimeType)
checks if the given mimetype denotes binary content
|
static boolean |
matches(String name,
String mimeType,
String defaultType) |
public static final String APPLICATION_OCTET_STREAM
public static String getMimeType(String name)
name - the namenullpublic static String getMimeType(String name, String defaultType)
name - the namedefaultType - type to return if no mapping is found.nullpublic static String getExtension(String mimeType)
mimeType - the mime typepublic static boolean isBinary(String mimeType)
mimeType - the mime typetrue if binary or if mimeType is nullpublic static boolean hasExtension(String mimeType, String ext)
mimeType - the mime typeext - the extensiontrue if the given mime type contains that extensionCopyright © 2010 - 2020 Adobe. All Rights Reserved