ikrs.util
Class MIMEType

java.lang.Object
  extended by ikrs.util.MIMEType

public class MIMEType
extends java.lang.Object

This is a simple MIME type implementation. The main purpose of this class is a mapping filename extension <-> MIME type.


Constructor Summary
MIMEType(java.lang.String type)
          The consutructor.
 
Method Summary
static MIMEType getByFileExtension(java.lang.String extension)
          This method tries to create a new MIME type from the given file extension (without the dot '.').
 java.lang.String getContentType()
          Get the full content-type string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MIMEType

public MIMEType(java.lang.String type)
The consutructor. The type param will not be validatet!

Method Detail

getContentType

public java.lang.String getContentType()
Get the full content-type string.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getByFileExtension

public static MIMEType getByFileExtension(java.lang.String extension)
This method tries to create a new MIME type from the given file extension (without the dot '.'). If the file extension cannot be found in the internal mapping the method returns null.

Parameters:
extension - The filename extension (search is not case sensitive).