public final class MIMEUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bareMIME(java.lang.String pMIME)
Removes any charset or extra info from the mime-type string (anything after a semicolon,
;, inclusive). |
static java.lang.String |
getExtension(java.lang.String pMIME)
Returns the default file extension for the given MIME type.
|
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getExtensionMappings()
Returns an unmodifiabale
Map view of the MIME to
extension mapping, to use as the default mapping in client applications. |
static java.util.List<java.lang.String> |
getExtensions(java.lang.String pMIME)
Returns all file extension for the given MIME type.
|
static java.lang.String |
getMIMEType(java.lang.String pFileExt)
Returns the default MIME type for the given file extension.
|
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getMIMETypeMappings()
Returns an unmodifiabale
Map view of the extension to
MIME mapping, to use as the default mapping in client applications. |
static java.util.List<java.lang.String> |
getMIMETypes(java.lang.String pFileExt)
Returns all MIME types for the given file extension.
|
static void |
main(java.lang.String[] pArgs)
For debugging.
|
public static java.lang.String getMIMEType(java.lang.String pFileExt)
pFileExt - the file extensionString containing the MIME type, or null if
there are no known MIME types for the given file extension.public static java.util.List<java.lang.String> getMIMETypes(java.lang.String pFileExt)
pFileExt - the file extensionList of Strings containing the MIME types, or an empty
list, if there are no known MIME types for the given file extension.public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getMIMETypeMappings()
Map view of the extension to
MIME mapping, to use as the default mapping in client applications.Map view of the extension to
MIME mapping.public static java.lang.String getExtension(java.lang.String pMIME)
null.pMIME - the MIME typeString containing the file extension, or null
if there are no known file extensions for the given MIME type.public static java.util.List<java.lang.String> getExtensions(java.lang.String pMIME)
pMIME - the MIME typeList of Strings containing the MIME types, or an empty
list, if there are no known file extensions for the given MIME type.public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getExtensionMappings()
Map view of the MIME to
extension mapping, to use as the default mapping in client applications.Map view of the MIME to
extension mapping.public static java.lang.String bareMIME(java.lang.String pMIME)
;, inclusive).pMIME - the mime-type stringpublic static void main(java.lang.String[] pArgs)
pArgs - command line argumentsCopyright © 2020. All Rights Reserved.