com.googlecode.fascinator.common
Class MimeTypeUtil

java.lang.Object
  extended by com.googlecode.fascinator.common.MimeTypeUtil

public class MimeTypeUtil
extends Object

Utility class to determine MIME type

Author:
Oliver Lucido

Field Summary
static String DEFAULT_MIME_TYPE
          Default Mime Type
 
Constructor Summary
MimeTypeUtil()
           
 
Method Summary
static String getMimeType(byte[] bytes, String filename)
          Gets the MIME type for the specified byte array and filename
static String getMimeType(File file)
          Gets the MIME type for the specified file
static String getMimeType(InputStream in)
          Gets the MIME type for the specified input stream
static String getMimeType(String filename)
          Gets the MIME type for the specified file name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MIME_TYPE

public static final String DEFAULT_MIME_TYPE
Default Mime Type

See Also:
Constant Field Values
Constructor Detail

MimeTypeUtil

public MimeTypeUtil()
Method Detail

getMimeType

public static String getMimeType(String filename)
Gets the MIME type for the specified file name

Parameters:
filename - a file name
Returns:
MIME type

getMimeType

public static String getMimeType(File file)
Gets the MIME type for the specified file

Parameters:
file - a file
Returns:
MIME type

getMimeType

public static String getMimeType(InputStream in)
Gets the MIME type for the specified input stream

Parameters:
in - an input stream
Returns:
MIME type

getMimeType

public static String getMimeType(byte[] bytes,
                                 String filename)
Gets the MIME type for the specified byte array and filename

Parameters:
bytes - a byte array
filename - a file name
Returns:
MIME type


Copyright © 2009-2013. All Rights Reserved.