org.apache.sling.javax.activation.internal
Class OsgiMailcapCommandMap

java.lang.Object
  extended by javax.activation.CommandMap
      extended by org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap

public class OsgiMailcapCommandMap
extends javax.activation.CommandMap

The OsgiMailcapCommandMap is a CommandMap which ensures that DataCommandHandler classes are loaded by their containing bundles.

This allows the javax.activation bundle to obey classloading contraints in an OSGi environment, while preserving most of the functionality available in an unmodified version of the bundle. Notably, this implementation does not support loading mailcap files which are not placed inside a bundle.


Constructor Summary
OsgiMailcapCommandMap()
           
 
Method Summary
 void addMailcapEntries(InputStream mailcapFile, org.osgi.framework.Bundle originatingBundle)
           
 javax.activation.DataContentHandler createDataContentHandler(String mimeType)
           
 javax.activation.CommandInfo[] getAllCommands(String mimeType)
           
 javax.activation.CommandInfo getCommand(String mimeType, String cmdName)
           
 String[] getMimeTypes()
           
 javax.activation.CommandInfo[] getPreferredCommands(String mimeType)
           
 void removeMailcapEntriesForBundle(org.osgi.framework.Bundle bundle)
           
 
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

OsgiMailcapCommandMap

public OsgiMailcapCommandMap()
Method Detail

addMailcapEntries

public void addMailcapEntries(InputStream mailcapFile,
                              org.osgi.framework.Bundle originatingBundle)
                       throws IOException
Throws:
IOException

removeMailcapEntriesForBundle

public void removeMailcapEntriesForBundle(org.osgi.framework.Bundle bundle)

getPreferredCommands

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

getAllCommands

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

getCommand

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

createDataContentHandler

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

getMimeTypes

public String[] getMimeTypes()
Overrides:
getMimeTypes in class javax.activation.CommandMap


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.