| java.lang.Object | ||
| ↳ | com.google.code.javax.activation.FileTypeMap | |
| ↳ | com.google.code.javax.activation.MimetypesFileTypeMap | |
This class extends FileTypeMap and provides data typing of files
via their file extension. It uses the .mime.types format.
MIME types file search order:
The MimetypesFileTypeMap looks in various places in the user's system for MIME types file entries. When requests are made to search for MIME types in the MimetypesFileTypeMap, it searches MIME types files in the following order:
.mime.types in the user's home directory.
/lib/mime.types.
META-INF/mime.types.
META-INF/mimetypes.default
(usually found only in the activation.jar file).
MIME types file format:
# comments begin with a '#'
# the format is <mime type> <space separated file extensions>
# for example:
text/plain txt text TXT
# this would map file.txt, file.text, and file.TXT to
# the mime type "text/plain"
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | PROG | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| DB | |||||||||||
| defDB | |||||||||||
| defaultType | |||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.activation.FileTypeMap
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
The default constructor.
| |||||||||||
Construct a MimetypesFileTypeMap with programmatic entries
added from the named file.
| |||||||||||
Construct a MimetypesFileTypeMap with programmatic entries
added from the InputStream.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Prepend the MIME type values to the registry.
| |||||||||||
Return the MIME type of the file object.
| |||||||||||
Return the MIME type based on the specified file name.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.activation.FileTypeMap
| |||||||||||
From class
java.lang.Object
| |||||||||||
The default constructor.
Construct a MimetypesFileTypeMap with programmatic entries added from the named file.
| mimeTypeFileName | The file name |
|---|
| IOException |
|---|
Construct a MimetypesFileTypeMap with programmatic entries added from the InputStream.
| is | The input stream to read from |
|---|
Prepend the MIME type values to the registry.
| mime_types | A .mime.types formatted string of entries. |
|---|
Return the MIME type of the file object.
The implementation in this class calls
getContentType(f.getName()).
| f | The file |
|---|
Return the MIME type based on the specified file name. The MIME type entries are searched as described above under MIME types file search order. If no entry is found, the type "application/octet-stream" is returned.
| filename | The file name |
|---|