Top Fields Constructors Methods
com.sun.activation.registries

public Class MimeTypeFile

Additional top-level class in compilation unit: LineTokenizer.

extends Object
Class Inheritance
Imports
java.io.*, java.util.*

Field Summary

Modifier and TypeField and Description
private String
private Hashtable<K, V>

Constructor Summary

AccessConstructor and Description
public
MimeTypeFile(String
The file name of the mime types file.
new_fname
)

The construtor that takes a filename as an argument.

public
public
MimeTypeFile()

Creates an empty DB.

Method Summary

Modifier and TypeMethod and Description
public void
appendToRegistry(String mime_types)

Appends string of entries to the types registry, must be valid .mime.types format.

public MimeTypeEntry
getMimeTypeEntry(String file_ext)

get the MimeTypeEntry based on the file extension

public String
getMIMETypeString(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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fnameback to summary
private String fname
type_hashback to summary
private Hashtable<K, V> type_hash

Constructor Detail

MimeTypeFileback to summary
public MimeTypeFile(String new_fname) throws IOException

The construtor that takes a filename as an argument.

Parameters
new_fname:String

The file name of the mime types file.

MimeTypeFileback to summary
public MimeTypeFile(InputStream is) throws IOException
MimeTypeFileback to summary
public MimeTypeFile()

Creates an empty DB.

Method Detail

appendToRegistryback to summary
public void appendToRegistry(String mime_types)

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

getMimeTypeEntryback to summary
public MimeTypeEntry getMimeTypeEntry(String file_ext)

get the MimeTypeEntry based on the file extension

getMIMETypeStringback to summary
public String getMIMETypeString(String file_ext)

Get the MIME type string corresponding to the file extension.

parseback to summary
private void parse(BufferedReader buf_reader) throws IOException

Parse a stream of mime.types entries.

parseEntryback to summary
private void parseEntry(String line)

Parse single mime.types entry.