public class

MimeTypeFile

extends Object
java.lang.Object
   ↳ com.sun.activation.registries.MimeTypeFile

Summary

Fields
private String fname
private Hashtable type_hash
Public Constructors
MimeTypeFile(String new_fname)
The construtor that takes a filename as an argument.
MimeTypeFile(InputStream is)
MimeTypeFile()
Creates an empty DB.
Public Methods
void appendToRegistry(String mime_types)
Appends string of entries to the types registry, must be valid .mime.types format.
String getMIMETypeString(String file_ext)
Get the MIME type string corresponding to the file extension.
MimeTypeEntry getMimeTypeEntry(String file_ext)
get the MimeTypeEntry based on the file extension
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String fname

private Hashtable type_hash

Public Constructors

public MimeTypeFile (String new_fname)

The construtor that takes a filename as an argument.

Parameters
new_fname The file name of the mime types file.
Throws
IOException

public MimeTypeFile (InputStream is)

Parameters
is
Throws
IOException

public MimeTypeFile ()

Creates an empty DB.

Public Methods

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

Parameters
mime_types

public String getMIMETypeString (String file_ext)

Get the MIME type string corresponding to the file extension.

Parameters
file_ext

public MimeTypeEntry getMimeTypeEntry (String file_ext)

get the MimeTypeEntry based on the file extension

Parameters
file_ext