public final class MimeTypes extends Object
The registry is initialized from the file org.opencastproject.util.MimeTypes.xml.
| Modifier and Type | Field and Description |
|---|---|
static MimeType |
AAC |
static MimeType |
CALENDAR |
static String |
DEFAULT_TYPE
Name of the mime type files
|
static String |
DEFINITION_FILE
Name of the mime type files
|
static MimeType |
DV |
static MimeType |
JAR |
static MimeType |
JPG |
static MimeType |
JSON |
static MimeType |
MATROSKA |
static Pattern |
MIME_TYPE_PATTERN |
static MimeType |
MJPEG |
static MimeType |
MJPEG2000 |
static MimeType |
MP3 |
static MimeType |
MPEG4 |
static MimeType |
MPEG4_AAC |
static MimeType |
PNG |
static MimeType |
SMIL |
static MimeType |
TEXT |
static com.entwinemedia.fn.Fn<String,com.entwinemedia.fn.data.Opt<MimeType>> |
toMimeType |
static MimeType |
XML
Common mime types
|
static MimeType |
ZIP |
| Modifier and Type | Method and Description |
|---|---|
static MimeType |
fromString(String name)
Returns a mime type for the provided file name.
|
static MimeType |
fromSuffix(String suffix)
Returns a mime type for the provided file suffix.
|
static MimeType |
fromURI(URI uri)
Returns a mime type for the provided file.
|
static String |
getMimeType(String name)
Convenience method to get a mime type as String from a filename extension
|
static MimeType |
parseMimeType(String mimeType)
Returns a mime type for the given type and subtype, e.
|
public static final Pattern MIME_TYPE_PATTERN
public static final String DEFINITION_FILE
public static final String DEFAULT_TYPE
public static final MimeType XML
public static final MimeType TEXT
public static final MimeType JSON
public static final MimeType JPG
public static final MimeType MJPEG
public static final MimeType MPEG4
public static final MimeType MATROSKA
public static final MimeType MPEG4_AAC
public static final MimeType DV
public static final MimeType MJPEG2000
public static final MimeType MP3
public static final MimeType AAC
public static final MimeType CALENDAR
public static final MimeType ZIP
public static final MimeType JAR
public static final MimeType SMIL
public static final MimeType PNG
public static MimeType parseMimeType(String mimeType)
video/mj2.mimeType - the mime typepublic static MimeType fromSuffix(String suffix) throws UnknownFileTypeException
For example, if the suffix is mj2, the mime type will be that of a ISO Motion JPEG 2000 document.
If no mime type is found for the suffix, a UnknownFileTypeException is thrown.
suffix - the file suffixUnknownFileTypeException - if the suffix does not map to a mime typepublic static MimeType fromURI(URI uri) throws UnknownFileTypeException
This method tries various ways to extract mime type information from the files name or its contents.
If no mime type can be derived from either the file name or its contents, a UnknownFileTypeException
is thrown.
uri - the fileUnknownFileTypeException - if the mime type cannot be derived from the filepublic static MimeType fromString(String name) throws UnknownFileTypeException
This method tries to find the mime type from the file name suffix (extension).
If no mime type can be derived from the file name, an UnknownFileTypeException
is thrown.
name - the fileUnknownFileTypeException - if the mime type cannot be derived from the fileCopyright © 2009–2020 Opencast Project. All rights reserved.