java.lang.Object
org.eclipse.angus.activation.MailcapFile
- All Implemented Interfaces:
MailcapRegistry
-
Constructor Summary
ConstructorDescriptionMailcap file default constructor.The constructor that takes an input stream as an argument.MailcapFile
(String new_fname) The constructor that takes a filename as an argument. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendToMailcap
(String mail_cap) appendToMailcap: Append to this Mailcap DB, use the mailcap format: Comment == "# comment string" Entry == "mimetype; javabeanclass"getMailcapFallbackList
(String mime_type) Get the Map of fallback MailcapEntries based on the MIME type.getMailcapList
(String mime_type) Get the Map of MailcapEntries based on the MIME type.String[]
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 void
A routine to parse individual entries in a Mailcap file.protected static void
reportParseError
(int expectedToken, int otherExpectedToken, int anotherExpectedToken, int actualToken, String actualTokenValue) protected static void
reportParseError
(int expectedToken, int otherExpectedToken, int actualToken, String actualTokenValue) protected static void
reportParseError
(int expectedToken, int actualToken, String actualTokenValue)
-
Constructor Details
-
MailcapFile
The constructor that takes a filename as an argument.- Parameters:
new_fname
- The file name of the mailcap file.- Throws:
IOException
- for I/O errors
-
MailcapFile
The constructor that takes an input stream as an argument.- Parameters:
is
- the input stream- Throws:
IOException
- for I/O errors
-
MailcapFile
public MailcapFile()Mailcap file default constructor.
-
-
Method Details
-
getMailcapList
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.
- Specified by:
getMailcapList
in interfaceMailcapRegistry
- Parameters:
mime_type
- the MIME type- Returns:
- the map of MailcapEntries
-
getMailcapFallbackList
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.
- Specified by:
getMailcapFallbackList
in interfaceMailcapRegistry
- Parameters:
mime_type
- the MIME type- Returns:
- the map of fallback MailcapEntries
-
getMimeTypes
Return all the MIME types known to this mailcap file.- Specified by:
getMimeTypes
in interfaceMailcapRegistry
- Returns:
- a String array of the MIME types
-
getNativeCommands
Return all the native comands for the given MIME type.- Specified by:
getNativeCommands
in interfaceMailcapRegistry
- Parameters:
mime_type
- the MIME type- Returns:
- a String array of the commands
-
appendToMailcap
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
- Specified by:
appendToMailcap
in interfaceMailcapRegistry
- Parameters:
mail_cap
- the mailcap string
-
parseLine
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
- the mailcap entry- Throws:
MailcapParseException
- for parse errorsIOException
- for I/O errors
-
reportParseError
protected static void reportParseError(int expectedToken, int actualToken, String actualTokenValue) throws MailcapParseException - Throws:
MailcapParseException
-
reportParseError
protected static void reportParseError(int expectedToken, int otherExpectedToken, int actualToken, String actualTokenValue) throws MailcapParseException - Throws:
MailcapParseException
-
reportParseError
protected static void reportParseError(int expectedToken, int otherExpectedToken, int anotherExpectedToken, int actualToken, String actualTokenValue) throws MailcapParseException - Throws:
MailcapParseException
-