org.objectweb.jac.util
Class MimeTypes

java.lang.Object
  extended byorg.objectweb.jac.util.MimeTypes

public class MimeTypes
extends Object

Maps mime types to their extensions


Constructor Summary
MimeTypes()
           
 
Method Summary
 String getMimeType(String filename)
          Returns the mime type associated with the extension of a filename
 Collection getMimeTypes()
          Returns all known mime types
 void read(Reader in)
          Read mime types definitions from a stream.
 void readDefaults()
          Initialize with defaults builtin values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeTypes

public MimeTypes()
Method Detail

readDefaults

public void readDefaults()
Initialize with defaults builtin values


read

public void read(Reader in)
          throws IOException
Read mime types definitions from a stream.

The format of the stream must be:

mime-type [extension ...]

Tabulations are not supported as separators!!!

Throws:
IOException

getMimeType

public String getMimeType(String filename)
Returns the mime type associated with the extension of a filename

Returns:
the mime type of null.

getMimeTypes

public Collection getMimeTypes()
Returns all known mime types