nl.uva.vlet.util
Class MimeTypes

java.lang.Object
  extended by nl.uva.vlet.util.MimeTypes

public class MimeTypes
extends java.lang.Object

Simple MimteType interface class


Method Summary
static java.lang.String getMagicMimeType(byte[] firstBytes)
          Returns the MimeType by checking against known the 'Magic' attribute of a file.
static java.lang.String getMagicMimeType(java.io.File file)
           
static java.lang.String getMimeType(java.lang.String path)
          Returns mimetype string by checking the extension or name of the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMimeType

public static java.lang.String getMimeType(java.lang.String path)
Returns mimetype string by checking the extension or name of the file


getMagicMimeType

public static java.lang.String getMagicMimeType(byte[] firstBytes)
                                         throws VlException
Returns the MimeType by checking against known the 'Magic' attribute of a file. Note that this method provides a better way to determinte the actual file type, but needs to read (some) bytes from the file.

Parameters:
firstBytes - The first bytes of a file
Returns:
Throws:
VlException

getMagicMimeType

public static java.lang.String getMagicMimeType(java.io.File file)