Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

nextapp.echoservlet.util
Class Extensions  view Extensions download Extensions.java

java.lang.Object
  extended bynextapp.echoservlet.util.Extensions

public class Extensions
extends java.lang.Object

Determines ContentType based on file extensions.


Field Summary
private static java.util.Map contentTypeMap
          A PropertyMap mapping extensions to content types
 
Constructor Summary
private Extensions()
          Non-instantiable class.
 
Method Summary
static ContentType getExtensionContentType(java.lang.String extension)
          Returns the content type associated with the specified extension.
static ContentType getFileNameContentType(java.lang.String fileName)
          Returns the content type associated with the provided file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentTypeMap

private static final java.util.Map contentTypeMap
A PropertyMap mapping extensions to content types

Constructor Detail

Extensions

private Extensions()
Non-instantiable class.

Method Detail

getExtensionContentType

public static ContentType getExtensionContentType(java.lang.String extension)
Returns the content type associated with the specified extension. If no content type is bound to the specified extension, null is returned.


getFileNameContentType

public static ContentType getFileNameContentType(java.lang.String fileName)
Returns the content type associated with the provided file name. The file name is parsed and its extension is retrieved.