Package com.sun.activation.registries
Class MimeTypeFile
java.lang.Object
com.sun.activation.registries.MimeTypeFile
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty DB.MimeTypeFile
(String new_fname) The construtor that takes a filename as an argument. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendToRegistry
(String mime_types) Appends string of entries to the types registry, must be valid .mime.types format.getMimeTypeEntry
(String file_ext) get the MimeTypeEntry based on the file extensiongetMIMETypeString
(String file_ext) Get the MIME type string corresponding to the file extension.private void
parse
(BufferedReader buf_reader) Parse a stream of mime.types entries.private void
parseEntry
(String line) Parse single mime.types entry.
-
Field Details
-
fname
-
type_hash
-
-
Constructor Details
-
MimeTypeFile
The construtor that takes a filename as an argument.- Parameters:
new_fname
- The file name of the mime types file.- Throws:
IOException
- for I/O errors
-
MimeTypeFile
- Throws:
IOException
-
MimeTypeFile
public MimeTypeFile()Creates an empty DB.
-
-
Method Details
-
getMimeTypeEntry
get the MimeTypeEntry based on the file extension- Parameters:
file_ext
- the file extension- Returns:
- the MimeTypeEntry
-
getMIMETypeString
Get the MIME type string corresponding to the file extension.- Parameters:
file_ext
- the file extension- Returns:
- the MIME type string
-
appendToRegistry
Appends string of entries to the types registry, must be valid .mime.types format. A mime.types entry is one of two forms: type/subtype ext1 ext2 ... or type=type/subtype desc="description of type" exts=ext1,ext2,... Example: # this is a test audio/basic au text/plain txt text type=application/postscript exts=ps,eps- Parameters:
mime_types
- the mime.types string
-
parse
Parse a stream of mime.types entries.- Throws:
IOException
-
parseEntry
Parse single mime.types entry.
-