nl.pbemengine.engine.ng.base.webserver
Class MIMERepository

java.lang.Object
  extended by nl.pbemengine.engine.ng.base.webserver.MIMERepository

public class MIMERepository
extends java.lang.Object

A repository of MIME types associated with file extensions, used for automatically determining the content-type to set for direct file requests rather than action invocations. Implementing rulesets that have file types not included in this repository can add them by invoking the addType method.

Author:
Jeroen Steenbeeke

Method Summary
 void addType(java.lang.String extension, java.lang.String mime)
          Add a MIME type associated with a given extension
static MIMERepository getInstance()
          Get an instance of the MIME repository
 java.lang.String getType(java.lang.String extension)
          Get the mime type for a given extension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MIMERepository getInstance()
Get an instance of the MIME repository

Returns:
A MIMERepository object

addType

public void addType(java.lang.String extension,
                    java.lang.String mime)
Add a MIME type associated with a given extension

Parameters:
extension - The extension to add the mime type for
mime - The MIME type for this extension

getType

public java.lang.String getType(java.lang.String extension)
Get the mime type for a given extension

Parameters:
extension - The extension to check for
Returns:
The MIME type as a String, or null if unknown.


Copyright © 2008. All Rights Reserved.