Package com.sun.activation.registries
Class MailcapFile
- java.lang.Object
-
- com.sun.activation.registries.MailcapFile
-
public class MailcapFile extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MailcapFile()Mailcap file default constructor.MailcapFile(java.io.InputStream is)The constructor that takes an input stream as an argument.MailcapFile(java.lang.String new_fname)The constructor that takes a filename as an argument.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendToMailcap(java.lang.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.ImageViewerjava.util.MapgetMailcapFallbackList(java.lang.String mime_type)Get the Map of fallback MailcapEntries based on the MIME type.java.util.MapgetMailcapList(java.lang.String mime_type)Get the Map of MailcapEntries based on the MIME type.java.lang.String[]getMimeTypes()Return all the MIME types known to this mailcap file.java.lang.String[]getNativeCommands(java.lang.String mime_type)Return all the native comands for the given MIME type.protected voidparseLine(java.lang.String mailcapEntry)A routine to parse individual entries in a Mailcap file.protected static voidreportParseError(int expectedToken, int otherExpectedToken, int anotherExpectedToken, int actualToken, java.lang.String actualTokenValue)protected static voidreportParseError(int expectedToken, int otherExpectedToken, int actualToken, java.lang.String actualTokenValue)protected static voidreportParseError(int expectedToken, int actualToken, java.lang.String actualTokenValue)
-
-
-
Constructor Detail
-
MailcapFile
public MailcapFile(java.lang.String new_fname) throws java.io.IOExceptionThe constructor that takes a filename as an argument.- Parameters:
new_fname- The file name of the mailcap file.- Throws:
java.io.IOException
-
MailcapFile
public MailcapFile(java.io.InputStream is) throws java.io.IOExceptionThe constructor that takes an input stream as an argument.- Parameters:
is- the input stream- Throws:
java.io.IOException
-
MailcapFile
public MailcapFile()
Mailcap file default constructor.
-
-
Method Detail
-
getMailcapList
public java.util.Map getMailcapList(java.lang.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 type/* and return that. Return the list of all that hit.
-
getMailcapFallbackList
public java.util.Map getMailcapFallbackList(java.lang.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 type/* and return that. Return the list of all that hit.
-
getMimeTypes
public java.lang.String[] getMimeTypes()
Return all the MIME types known to this mailcap file.
-
getNativeCommands
public java.lang.String[] getNativeCommands(java.lang.String mime_type)
Return all the native comands for the given MIME type.
-
appendToMailcap
public void appendToMailcap(java.lang.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
-
parseLine
protected void parseLine(java.lang.String mailcapEntry) throws MailcapParseException, java.io.IOExceptionA 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.- Throws:
MailcapParseExceptionjava.io.IOException
-
reportParseError
protected static void reportParseError(int expectedToken, int actualToken, java.lang.String actualTokenValue) throws MailcapParseException- Throws:
MailcapParseException
-
reportParseError
protected static void reportParseError(int expectedToken, int otherExpectedToken, int actualToken, java.lang.String actualTokenValue) throws MailcapParseException- Throws:
MailcapParseException
-
reportParseError
protected static void reportParseError(int expectedToken, int otherExpectedToken, int anotherExpectedToken, int actualToken, java.lang.String actualTokenValue) throws MailcapParseException- Throws:
MailcapParseException
-
-