javax.activation
Class MailcapCommandMap

java.lang.Object
  extended by javax.activation.CommandMap
      extended by javax.activation.MailcapCommandMap
Direct Known Subclasses:
OsgiMailcapCommandMap

public class MailcapCommandMap
extends CommandMap

Version:
$Rev: 752899 $ $Date: 2009-03-12 16:33:19 +0100 (Do, 12. M��r 2009) $

Constructor Summary
MailcapCommandMap()
           
MailcapCommandMap(InputStream is)
           
MailcapCommandMap(String fileName)
           
 
Method Summary
protected  void addCommand(Map commandList, String mimeType, CommandInfo command)
          Add a command to a target command list (preferred or fallback).
protected  void addCommands(String mimeType, List commands, boolean fallback)
          Add a parsed list of commands to the appropriate command list.
 void addMailcap(String mail_cap)
           
 DataContentHandler createDataContentHandler(String mimeType)
           
 CommandInfo[] getAllCommands(String mimeType)
           
 CommandInfo getCommand(String mimeType, String cmdName)
           
 String[] getMimeTypes()
          Get all MIME types known to this command map.
 String[] getNativeCommands(String mimeType)
          Return the list of raw command strings parsed from the mailcap files for a given mimeType.
 CommandInfo[] getPreferredCommands(String mimeType)
           
 
Methods inherited from class javax.activation.CommandMap
createDataContentHandler, getAllCommands, getCommand, getDefaultCommandMap, getPreferredCommands, setDefaultCommandMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailcapCommandMap

public MailcapCommandMap()

MailcapCommandMap

public MailcapCommandMap(String fileName)
                  throws IOException
Throws:
IOException

MailcapCommandMap

public MailcapCommandMap(InputStream is)
Method Detail

addMailcap

public void addMailcap(String mail_cap)

addCommands

protected void addCommands(String mimeType,
                           List commands,
                           boolean fallback)
Add a parsed list of commands to the appropriate command list.

Parameters:
mimeType - The mimeType name this is added under.
commands - A List containing the command information.
fallback - The target list identifier.

addCommand

protected void addCommand(Map commandList,
                          String mimeType,
                          CommandInfo command)
Add a command to a target command list (preferred or fallback).

Parameters:
commandList - The target command list.
mimeType - The MIME type the command is associated with.
command - The command information.

getPreferredCommands

public CommandInfo[] getPreferredCommands(String mimeType)
Specified by:
getPreferredCommands in class CommandMap

getAllCommands

public CommandInfo[] getAllCommands(String mimeType)
Specified by:
getAllCommands in class CommandMap

getCommand

public CommandInfo getCommand(String mimeType,
                              String cmdName)
Specified by:
getCommand in class CommandMap

createDataContentHandler

public DataContentHandler createDataContentHandler(String mimeType)
Specified by:
createDataContentHandler in class CommandMap

getMimeTypes

public String[] getMimeTypes()
Get all MIME types known to this command map.

Overrides:
getMimeTypes in class CommandMap
Returns:
A String array of the MIME type names.

getNativeCommands

public String[] getNativeCommands(String mimeType)
Return the list of raw command strings parsed from the mailcap files for a given mimeType.

Parameters:
mimeType - The target mime type
Returns:
A String array of the raw command strings. Returns an empty array if the mimetype is not currently known.


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.