public static class MimetypesFileTypeMap
extends java.lang.Object
.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.
mime.types
in the Java runtime.
META-INF/mime.types
.
META-INF/mimetypes.default
(usually found only in the activation.jar
file).
(The current implementation looks for the mime.types
file
in the Java runtime in the directory java.home/conf
if it exists, and otherwise in the directory
java.home/lib
, where java.home is the value
of the "java.home" System property. Note that the "conf" directory was
introduced in JDK 9.)
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"