org.loom.util
Class MimeUtils

java.lang.Object
  extended by org.loom.util.MimeUtils

public class MimeUtils
extends java.lang.Object

Guess the mime type of a file, given its extension. Useful when the browser did not provide it. This is a simplified list, more complete lists are available e.g. in the apache sources.


Constructor Summary
MimeUtils()
           
 
Method Summary
static java.lang.String guessMimeType(java.lang.String fileName)
           
static boolean requiresCharset(java.lang.String mimeType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeUtils

public MimeUtils()
Method Detail

requiresCharset

public static boolean requiresCharset(java.lang.String mimeType)
Parameters:
mimeType - The MIME Content-Type to consider
Returns:
true if the provided MIME type requires a charset

guessMimeType

public static java.lang.String guessMimeType(java.lang.String fileName)
Returns:
the MIME type of a file, null if unknown