public class MimetypesFileTypeMap extends FileTypeMap
| Constructor and Description |
|---|
MimetypesFileTypeMap()
Default constructor.
|
MimetypesFileTypeMap(InputStream is)
Constructor specifying an input stream.
|
MimetypesFileTypeMap(String mimeTypeFileName)
Constructor specifying a filename.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMimeTypes(String mime_types)
Adds entries prorammatically to the registry.
|
String |
getContentType(File f)
Returns the MIME content type of the file.
|
String |
getContentType(String filename)
Returns the MIME type based on the given filename.
|
getDefaultFileTypeMap, setDefaultFileTypeMappublic MimetypesFileTypeMap()
public MimetypesFileTypeMap(String mimeTypeFileName) throws IOException
mimeTypeFileName - the name of the file to read mime.types
entries fromIOExceptionpublic MimetypesFileTypeMap(InputStream is)
is - the input stream to read mime.types entries frompublic void addMimeTypes(String mime_types)
mime_types - a mime.types formatted entries stringpublic String getContentType(File f)
getContentType(f.getName()).getContentType in class FileTypeMapf - the filepublic String getContentType(String filename)
getContentType in class FileTypeMapfilename - the filename