chrriis.common
Class MimeTypes

java.lang.Object
  extended by chrriis.common.MimeTypes

public class MimeTypes
extends Object

A utility class to get mime type mappings.

Author:
Christopher Deckers

Method Summary
static void addMissingMimeType(String extension, String mimeType)
          Add (or replace) a mime type for a given extension.
static String getMimeType(String extension)
          Get the mime type associated to a particular extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMimeType

public static String getMimeType(String extension)
Get the mime type associated to a particular extension.

Returns:
null if no mapping exists.

addMissingMimeType

public static void addMissingMimeType(String extension,
                                      String mimeType)
Add (or replace) a mime type for a given extension. This method is useful when a new mime type needs to be supported and the library does not yet contain it.