dsto.dfc.net
Class DfcContentHandlerFactory
java.lang.Object
dsto.dfc.net.DfcContentHandlerFactory
- All Implemented Interfaces:
- ContentHandlerFactory
public class DfcContentHandlerFactory
- extends Object
- implements ContentHandlerFactory
A generic URL ContentHandlerFactory that allows handlers to
dynamically associated with their MIME type.
NOTE: Use DfcFileNameMap
to map URL's by their file
extensions to a given MIME type.
- Version:
- $Revision$
- Author:
- Matthew Phillips
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DfcContentHandlerFactory
public DfcContentHandlerFactory()
registerFactory
public static void registerFactory()
throws Error
- Register this class as the system-wide content handler factory.
- Throws:
Error
- if something else is already registered as the
system content handler factory.
registerHandler
public static void registerHandler(String mimeType,
String handlerPkg,
ContentHandler handler)
- Register a handler with a MIME type.
- Parameters:
mimeType
- The MIME type.handlerPkg
- The base package of the handler class, minus
the major.minor part. Eg if handler is dfc.handlers.text.plain,
handlerPkg should be dfc.handlers. This package is added to the
system-wide handlers property.handler
- The handler for the given MIME type.
createContentHandler
public ContentHandler createContentHandler(String mimeType)
- Specified by:
createContentHandler
in interface ContentHandlerFactory
Copyright © 2008 Commonwealth of Australia