31 import com.sun.activation.registries.MimeTypeFile; |
31 import com.sun.activation.registries.MimeTypeFile; |
32 import com.sun.activation.registries.LogSupport; |
32 import com.sun.activation.registries.LogSupport; |
33 |
33 |
34 /** |
34 /** |
35 * This class extends FileTypeMap and provides data typing of files |
35 * This class extends FileTypeMap and provides data typing of files |
36 * via their file extension. It uses the <code>.mime.types</code> format. <p> |
36 * via their file extension. It uses the {@code .mime.types} format. <p> |
37 * |
37 * |
38 * <b>MIME types file search order:</b><p> |
38 * <b>MIME types file search order:</b><p> |
39 * The MimetypesFileTypeMap looks in various places in the user's |
39 * The MimetypesFileTypeMap looks in various places in the user's |
40 * system for MIME types file entries. When requests are made |
40 * system for MIME types file entries. When requests are made |
41 * to search for MIME types in the MimetypesFileTypeMap, it searches |
41 * to search for MIME types in the MimetypesFileTypeMap, it searches |
42 * MIME types files in the following order: |
42 * MIME types files in the following order: |
43 * <p> |
|
44 * <ol> |
43 * <ol> |
45 * <li> Programmatically added entries to the MimetypesFileTypeMap instance. |
44 * <li> Programmatically added entries to the MimetypesFileTypeMap instance. |
46 * <li> The file <code>.mime.types</code> in the user's home directory. |
45 * <li> The file {@code .mime.types} in the user's home directory. |
47 * <li> The file <<i>java.home</i>><code>/lib/mime.types</code>. |
46 * <li> The file {@literal <}<i>java.home</i>{@literal >}{@code /lib/mime.types}. |
48 * <li> The file or resources named <code>META-INF/mime.types</code>. |
47 * <li> The file or resources named {@code META-INF/mime.types}. |
49 * <li> The file or resource named <code>META-INF/mimetypes.default</code> |
48 * <li> The file or resource named {@code META-INF/mimetypes.default} |
50 * (usually found only in the <code>activation.jar</code> file). |
49 * (usually found only in the {@code activation.jar} file). |
51 * </ol> |
50 * </ol> |
52 * <p> |
51 * <p> |
53 * <b>MIME types file format:</b><p> |
52 * <b>MIME types file format:</b> |
54 * |
53 * |
55 * <code> |
54 * <pre>{@code |
56 * # comments begin with a '#'<br> |
55 * # comments begin with a '#' |
57 * # the format is <mime type> <space separated file extensions><br> |
56 * # the format is <mime type> <space separated file extensions> |
58 * # for example:<br> |
57 * # for example: |
59 * text/plain txt text TXT<br> |
58 * text/plain txt text TXT |
60 * # this would map file.txt, file.text, and file.TXT to<br> |
59 * # this would map file.txt, file.text, and file.TXT to |
61 * # the mime type "text/plain"<br> |
60 * # the mime type "text/plain" |
62 * </code> |
61 * }</pre> |
63 * |
62 * |
64 * @author Bart Calder |
63 * @author Bart Calder |
65 * @author Bill Shannon |
64 * @author Bill Shannon |
66 * |
65 * |
67 * @since 1.6 |
66 * @since 1.6 |