public class MimeType extends 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(String extension,
String contentType)
Associates the specified extension and content type
|
static boolean |
contains(String extension) |
static String |
get(String extension) |
static String |
get(String extension,
String defaultCt) |
static String |
getByFilename(String fileName) |
public static String get(String extension)
extension - the extensionextension. If no association is found, this method will
return text/plainpublic static String get(String extension, 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(String extension)
extension - the extensiontrue if the specified extension has been registered otherwise, returns falsepublic static void add(String extension, String contentType)
Associates the specified extension and content type
extension - the extensioncontentType - the content type associated with the extensionCopyright © 2016 Oracle Corporation. All Rights Reserved.