⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
javax.activation

Class MailcapCommandMap

java.lang.Object
|
+--javax.activation.CommandMap
   |
   +--javax.activation.MailcapCommandMap


public class MailcapCommandMap
extends CommandMap

Implementation of a command map using a mailcap file (RFC 1524). Mailcap files are searched for in the following places:
  1. Programmatically added entries to this interface
  2. the file .mailcap in the user's home directory
  3. the file <java.home>/lib/mailcap
  4. the resource META-INF/mailcap
  5. the resource META-INF/mailcap.default in the JAF distribution
Author:

Constructor Summary

MailcapCommandMap()

Default constructor.

MailcapCommandMap(String fileName)

Constructor specifying a filename.

MailcapCommandMap(InputStream is)

Constructor specifying an input stream.

Method Summary

synchronized void

addMailcap(String mail_cap)

Adds entries programmatically to the registry.

synchronized DataContentHandler

createDataContentHandler(String mimeType)

Returns the DCH for the specified MIME type.

synchronized CommandInfo[]

getAllCommands(String mimeType)

Returns all commands for the given MIME type.

synchronized CommandInfo

getCommand(String mimeType, String cmdName)

Returns the command with the specified name for the given MIME type.

synchronized CommandInfo[]

getPreferredCommands(String mimeType)

Returns the list of preferred commands for a given MIME type.

Constructor Details

MailcapCommandMap

public MailcapCommandMap()

Default constructor.


MailcapCommandMap

public MailcapCommandMap(InputStream is)

Constructor specifying an input stream.

Parameters:
is - the input stream to read mailcap entries from

MailcapCommandMap

public MailcapCommandMap(String fileName)

Constructor specifying a filename.

Parameters:
fileName - the name of the file to read mailcap entries from

Method Details

addMailcap

public synchronized void addMailcap(String mail_cap)

Adds entries programmatically to the registry.

Parameters:
mail_cap - a mailcap string

createDataContentHandler

public synchronized DataContentHandler createDataContentHandler(String mimeType)

Returns the DCH for the specified MIME type.

Parameters:
mimeType - the MIME type

getAllCommands

public synchronized CommandInfo[] getAllCommands(String mimeType)

Returns all commands for the given MIME type.

Parameters:
mimeType - the MIME type

getCommand

public synchronized CommandInfo getCommand(String mimeType, String cmdName)

Returns the command with the specified name for the given MIME type.

Parameters:
mimeType - the MIME type
cmdName - the command verb

getPreferredCommands

public synchronized CommandInfo[] getPreferredCommands(String mimeType)

Returns the list of preferred commands for a given MIME type.

Parameters:
mimeType - the MIME type