de.hs_rm.cs.lecturenotes.shared.util
Class MimeTypeUtil

java.lang.Object
  extended by de.hs_rm.cs.lecturenotes.shared.util.MimeTypeUtil

public final class MimeTypeUtil
extends java.lang.Object

MimeType Utility class.

Version:
$LastChangedRevision: 262 $
Author:
Enrico Homann

Method Summary
 void defaultValues()
          Adds some default values.
static MimeTypeUtil getInstance()
          Will return the singleton instance.
 MimeType getMimeTypeByFilename(boolean bCaseSensitive, java.lang.String filename)
          Will return the first found corresponding MimeType to String filename bases upon it's extension.
 java.util.List<MimeType> getRegisteredMimeTypes()
          Will return a List of all registered MimeType objects.
 void registerMimeType(MimeType oMimeType)
          Registers a new MimeType object.
 void setRegisteredMimeTypes(java.util.List<MimeType> oRegisteredMimeTypes)
          Replaces the List of registered MimeType objects with regiteredMimeTypes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MimeTypeUtil getInstance()
Will return the singleton instance.

Returns:
MimeTypeUtil

defaultValues

public void defaultValues()
Adds some default values.


registerMimeType

public void registerMimeType(MimeType oMimeType)
Registers a new MimeType object.

Parameters:
oMimeType - MimeType

getRegisteredMimeTypes

public java.util.List<MimeType> getRegisteredMimeTypes()
Will return a List of all registered MimeType objects.

Returns:
List of MimeType.

setRegisteredMimeTypes

public void setRegisteredMimeTypes(java.util.List<MimeType> oRegisteredMimeTypes)
Replaces the List of registered MimeType objects with regiteredMimeTypes.

Parameters:
oRegisteredMimeTypes - List of MimeType

getMimeTypeByFilename

public MimeType getMimeTypeByFilename(boolean bCaseSensitive,
                                      java.lang.String filename)
Will return the first found corresponding MimeType to String filename bases upon it's extension. Returns null if the mime type is unknown. Case sensitivity is set by boolean bCaseSensitive

Parameters:
bCaseSensitive - boolean TRUE stands for case sensitive, while FALSE means case insensitive
filename - String
Returns:
MimeType