ERMimeTypeManager Class Reference

Collaboration diagram for ERMimeTypeManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void addMimeType (ERMimeType mimeType)
void clearMimeTypes ()
String extensionForFileName (String fileName)
ERMimeType mimeTypeForExtension (String extension, boolean exceptionIfNotFound)
ERMimeType mimeTypeForFile (File file, boolean exceptionIfNotFound)
ERMimeType mimeTypeForFileName (String fileName, boolean exceptionIfNotFound)
ERMimeType mimeTypeForMimeTypeString (String mimeType, boolean exceptionIfNotFound)
ERMimeType mimeTypeForUTI (String uti, boolean exceptionIfNotFound)
void removeMimeType (ERMimeType mimeType)

Static Public Member Functions

static synchronized
ERMimeTypeManager 
mimeTypeManager ()
static String primaryExtension (String mimeTypeStr)

Private Member Functions

 ERMimeTypeManager ()

Private Attributes

List< ERMimeType_mimeTypes

Static Private Attributes

static ERMimeTypeManager INSTANCE


Constructor & Destructor Documentation

ERMimeTypeManager (  )  [private]


Member Function Documentation

void addMimeType ( ERMimeType  mimeType  ) 

Adds a mime type definition to the manager.

Parameters:
mimeType the mime type to add

void clearMimeTypes (  ) 

Removes all the mime types from this manager.

String extensionForFileName ( String  fileName  ) 

Returns the extension for the given filename.

Parameters:
fileName the filename
Returns:
the extension of the filename (or null)

ERMimeType mimeTypeForExtension ( String  extension,
boolean  exceptionIfNotFound 
)

Returns the ERMimeType for the given file extension, optionally throwing an exception if the type isn't found.

Parameters:
extension the file extension to lookup
exceptionIfNotFound if true, a NoSuchElementException exception is thrown if the mime type isn't found
Returns:
the matching ERMimeType

ERMimeType mimeTypeForFile ( File  file,
boolean  exceptionIfNotFound 
)

Returns the ERMimeType for the given file, optionally throwing an exception if the type isn't found.

Parameters:
file the file to lookup
exceptionIfNotFound if true, a NoSuchElementException exception is thrown if the mime type isn't found
Returns:
the matching ERMimeType

ERMimeType mimeTypeForFileName ( String  fileName,
boolean  exceptionIfNotFound 
)

Returns the ERMimeType for the given file name, optionally throwing an exception if the type isn't found.

Parameters:
fileName the file name to lookup
exceptionIfNotFound if true, a NoSuchElementException exception is thrown if the mime type isn't found
Returns:
the matching ERMimeType

ERMimeType mimeTypeForMimeTypeString ( String  mimeType,
boolean  exceptionIfNotFound 
)

Returns the ERMimeType for the given mime type string, optionally throwing an exception if the type isn't found.

Parameters:
mimeType the mime type string to lookup
exceptionIfNotFound if true, a NoSuchElementException exception is thrown if the mime type isn't found
Returns:
the matching ERMimeType

ERMimeType mimeTypeForUTI ( String  uti,
boolean  exceptionIfNotFound 
)

Returns the ERMimeType for the given UTI, optionally throwing an exception if the type isn't found.

Parameters:
uti the UTI to lookup
exceptionIfNotFound if true, a NoSuchElementException exception is thrown if the mime type isn't found
Returns:
the matching ERMimeType

static synchronized ERMimeTypeManager mimeTypeManager (  )  [static]

Returns the singleton mime type manager. See the top level documentation on information about configuring custom mime types.

Returns:
the singleton mime type manager

static String primaryExtension ( String  mimeTypeStr  )  [static]

Returns the primary extension for the given mime type.

Parameters:
mimeTypeStr the mime type string to lookup
Returns:
the primary extension or null if there is no mime type in the system that matches

void removeMimeType ( ERMimeType  mimeType  ) 

Removes the given mime type definition from this manager.

Parameters:
mimeType the mime type to remove


Member Data Documentation

List<ERMimeType> _mimeTypes [private]

ERMimeTypeManager INSTANCE [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:43 2012 for Project Wonder by  doxygen 1.5.8