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