public class MimeTypes
extends java.lang.Object
See also: http://www.iana.org/assignments/media-types/ http://www.webmaster-toolkit.com/mime-types.shtml
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MIME_APPLICATION_ATOM_XML |
static java.lang.String |
MIME_APPLICATION_JAVASCRIPT |
static java.lang.String |
MIME_APPLICATION_JSON |
static java.lang.String |
MIME_APPLICATION_OCTET_STREAM |
static java.lang.String |
MIME_APPLICATION_XML |
static java.lang.String |
MIME_TEXT_CSS |
static java.lang.String |
MIME_TEXT_HTML |
static java.lang.String |
MIME_TEXT_PLAIN |
Constructor and Description |
---|
MimeTypes() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
findExtensionsByMimeTypes(java.lang.String mimeType,
boolean useWildcard)
Finds all extensions that belong to given mime type(s).
|
static java.lang.String |
getMimeType(java.lang.String ext)
Returns the corresponding MIME type to the given extension.
|
static boolean |
isRegisteredExtension(java.lang.String extension)
Returns
true if given value is one of the registered MIME extensions. |
static java.lang.String |
lookupMimeType(java.lang.String ext)
Simply returns MIME type or
null if no type is found. |
static void |
registerMimeType(java.lang.String ext,
java.lang.String mimeType)
Registers MIME type for provided extension.
|
public static final java.lang.String MIME_APPLICATION_ATOM_XML
public static final java.lang.String MIME_APPLICATION_JAVASCRIPT
public static final java.lang.String MIME_APPLICATION_JSON
public static final java.lang.String MIME_APPLICATION_OCTET_STREAM
public static final java.lang.String MIME_APPLICATION_XML
public static final java.lang.String MIME_TEXT_CSS
public static final java.lang.String MIME_TEXT_PLAIN
public static final java.lang.String MIME_TEXT_HTML
public static void registerMimeType(java.lang.String ext, java.lang.String mimeType)
public static java.lang.String getMimeType(java.lang.String ext)
application/octet-stream
type.public static java.lang.String lookupMimeType(java.lang.String ext)
null
if no type is found.public static java.lang.String[] findExtensionsByMimeTypes(java.lang.String mimeType, boolean useWildcard)
mimeType
- list of mime types, separated by commauseWildcard
- if set, mime types are wildcard patternspublic static boolean isRegisteredExtension(java.lang.String extension)
true
if given value is one of the registered MIME extensions.Copyright © 2003-present Jodd Team