dsto.dfc.net
Class DfcFileNameMap

java.lang.Object
  extended by dsto.dfc.net.DfcFileNameMap
All Implemented Interfaces:
FileNameMap

public class DfcFileNameMap
extends Object
implements FileNameMap

A file name map that allows dynamic mapping of file extensions to MIME types. Daisy chains to the default system file map if no mapping is found.

This class is intended to be used to connect file URL's to their content handler, usually via DfcContentHandlerFactory.

Version:
$Revision$

Constructor Summary
DfcFileNameMap()
           
 
Method Summary
 String getContentTypeFor(String fileName)
           
static void registerMap()
          Register this class as the system wide file map.
static void registerTypeForExtension(String extension, String mimeType)
          Associate a file extension with a MIME type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DfcFileNameMap

public DfcFileNameMap()
Method Detail

registerMap

public static void registerMap()
Register this class as the system wide file map. May be called more than once.


registerTypeForExtension

public static void registerTypeForExtension(String extension,
                                            String mimeType)
Associate a file extension with a MIME type.

Parameters:
extension - The extension (without ".").
mimeType - The MIME type for the extension.

getContentTypeFor

public String getContentTypeFor(String fileName)
Specified by:
getContentTypeFor in interface FileNameMap


Copyright © 2008 Commonwealth of Australia