public class FileTypesHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MIME_TYPE
Default mime-type.
|
Constructor and Description |
---|
FileTypesHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addExtension(java.lang.String extension,
java.lang.String MIMEType)
Adds a mime-type mapping for the given filename extension.
|
static java.util.Map |
getExtensionToMIMETypeMapping()
Gets the internal file extension to mime-type mapping.
|
static java.lang.String |
getMIMEType(java.io.File file)
Gets the mime-type for a file.
|
static java.lang.String |
getMIMEType(java.lang.String fileName)
Gets the mime-type of a file.
|
public static final java.lang.String DEFAULT_MIME_TYPE
public static java.lang.String getMIMEType(java.lang.String fileName)
fileName
- the name of the file whose mime-type is requested.String
for the given filenamepublic static java.lang.String getMIMEType(java.io.File file)
file
- the file whose mime-type is requested.String
public static void addExtension(java.lang.String extension, java.lang.String MIMEType)
extension
- the filename extension to be associated with
MIMEType
.MIMEType
- the new mime-type for extension
.public static java.util.Map getExtensionToMIMETypeMapping()