public class MimeTypes extends Object
| Constructor and Description |
|---|
MimeTypes() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getContentType(String filename)
return the content-type from a file name.
|
static String |
getContentType(String filename,
String defaultContentType)
return the content-type from a file name.
|
static String |
getMimeType(String filename)
return the mimetype from a file name
|
static String |
getMimeType(String filename,
String defaultMimeType)
return the mimetype from a file name.
|
static boolean |
isValidMimeType(String mimeType)
check the mimetype is referenced in the mimetypes database
|
public static String getMimeType(String filename)
filename - the file namepublic static String getMimeType(String filename, String defaultMimeType)
filename - the file namedefaultMimeType - the default mime type to return when no matching mimetype is foundpublic static String getContentType(String filename)
filename - the file namepublic static String getContentType(String filename, String defaultContentType)
filename - the file namedefaultContentType - the default content-type to return when no matching content-type is foundpublic static boolean isValidMimeType(String mimeType)
mimeType - the mimeType to verifyGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly