public class MimeType
extends java.lang.Object
add(String, String), however, keep in mind that these mappings are per-JVM.| Constructor and Description |
|---|
MimeType() |
| Modifier and Type | Method and Description |
|---|---|
static void |
add(java.lang.String extension,
java.lang.String contentType)
Associates the specified extension and content type
|
static boolean |
contains(java.lang.String extension) |
static java.lang.String |
get(java.lang.String extension) |
static java.lang.String |
get(java.lang.String extension,
java.lang.String defaultCt) |
static java.lang.String |
getByFilename(java.lang.String fileName) |
public static java.lang.String get(java.lang.String extension)
extension - the extensionextension. If no association is found, this method will
return text/plainpublic static java.lang.String get(java.lang.String extension,
java.lang.String defaultCt)
extension - the extensiondefaultCt - the content type to return if there is no known association for the specified extensionextension or if no associate is found, returns
defaultCtpublic static boolean contains(java.lang.String extension)
extension - the extensiontrue if the specified extension has been registered otherwise, returns falsepublic static void add(java.lang.String extension,
java.lang.String contentType)
Associates the specified extension and content type
extension - the extensioncontentType - the content type associated with the extensionpublic static java.lang.String getByFilename(java.lang.String fileName)
fileName - the filenameextension of the
given filename or if no associate is found, returns
nullCopyright © 2018 Oracle Corporation. All Rights Reserved.