public class

MailcapFile

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

Summary

Fields
private static boolean addReverse
private Map fallback_hash Another Map like above, but for fallback entries.
private Map native_commands A Map indexed by MIME type (string) that references a List of native commands (string) corresponding to the type.
private Map type_hash A Map indexed by MIME type (string) that references a Map of commands for each type.
Public Constructors
MailcapFile(String new_fname)
The constructor that takes a filename as an argument.
MailcapFile(InputStream is)
The constructor that takes an input stream as an argument.
MailcapFile()
Mailcap file default constructor.
Public Methods
void appendToMailcap(String mail_cap)
appendToMailcap: Append to this Mailcap DB, use the mailcap format: Comment == "# comment string Entry == "mimetype; javabeanclass Example: # this is a comment image/gif jaf.viewers.ImageViewer
Map getMailcapFallbackList(String mime_type)
Get the Map of fallback MailcapEntries based on the MIME type.
Map getMailcapList(String mime_type)
Get the Map of MailcapEntries based on the MIME type.
String[] getMimeTypes()
Return all the MIME types known to this mailcap file.
String[] getNativeCommands(String mime_type)
Return all the native comands for the given MIME type.
Protected Methods
void parseLine(String mailcapEntry)
A routine to parse individual entries in a Mailcap file.
static void reportParseError(int expectedToken, int otherExpectedToken, int anotherExpectedToken, int actualToken, String actualTokenValue)
static void reportParseError(int expectedToken, int otherExpectedToken, int actualToken, String actualTokenValue)
static void reportParseError(int expectedToken, int actualToken, String actualTokenValue)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private static boolean addReverse

private Map fallback_hash

Another Map like above, but for fallback entries.

private Map native_commands

A Map indexed by MIME type (string) that references a List of native commands (string) corresponding to the type.

private Map type_hash

A Map indexed by MIME type (string) that references a Map of commands for each type. The comand Map is indexed by the command name and references a List of class names (strings) for each command.

Public Constructors

public MailcapFile (String new_fname)

The constructor that takes a filename as an argument.

Parameters
new_fname The file name of the mailcap file.
Throws
IOException

public MailcapFile (InputStream is)

The constructor that takes an input stream as an argument.

Parameters
is The input stream
Throws
IOException

public MailcapFile ()

Mailcap file default constructor.

Public Methods

public void appendToMailcap (String mail_cap)

appendToMailcap: Append to this Mailcap DB, use the mailcap format: Comment == "# comment string Entry == "mimetype; javabeanclass Example: # this is a comment image/gif jaf.viewers.ImageViewer

Parameters
mail_cap

public Map getMailcapFallbackList (String mime_type)

Get the Map of fallback MailcapEntries based on the MIME type.

Semantics: First check for the literal mime type, if that fails looks for wildcard /\* and return that. Return the list of all that hit.

Parameters
mime_type

public Map getMailcapList (String mime_type)

Get the Map of MailcapEntries based on the MIME type.

Semantics: First check for the literal mime type, if that fails looks for wildcard /\* and return that. Return the list of all that hit.

Parameters
mime_type

public String[] getMimeTypes ()

Return all the MIME types known to this mailcap file.

public String[] getNativeCommands (String mime_type)

Return all the native comands for the given MIME type.

Parameters
mime_type

Protected Methods

protected void parseLine (String mailcapEntry)

A routine to parse individual entries in a Mailcap file. Note that this routine does not handle line continuations. They should have been handled prior to calling this routine.

Parameters
mailcapEntry
Throws
IOException
MailcapParseException

protected static void reportParseError (int expectedToken, int otherExpectedToken, int anotherExpectedToken, int actualToken, String actualTokenValue)

Parameters
expectedToken
otherExpectedToken
anotherExpectedToken
actualToken
actualTokenValue

protected static void reportParseError (int expectedToken, int otherExpectedToken, int actualToken, String actualTokenValue)

Parameters
expectedToken
otherExpectedToken
actualToken
actualTokenValue

protected static void reportParseError (int expectedToken, int actualToken, String actualTokenValue)

Parameters
expectedToken
actualToken
actualTokenValue