NextApp Echo
App Container 1.0.5

nextapp.echoservlet.util
Class Extensions

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.

Parameters:
extension - The extension whose content type is to be determined.
Returns:
The content type which corresponds to the given extension.

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.

Parameters:
fileName - The file name whose content type is to be determined.
Returns:
The content type which corresponds to the given file name.

NextApp Echo
App Container 1.0.5