javax.activation
Class FileTypeMap

java.lang.Object
  extended by javax.activation.FileTypeMap
Direct Known Subclasses:
MimetypesFileTypeMap

public abstract class FileTypeMap
extends java.lang.Object

Classifier for the MIME content type of files.


Constructor Summary
FileTypeMap()
           
 
Method Summary
abstract  java.lang.String getContentType(java.io.File file)
          Returns the content type of the specified file.
abstract  java.lang.String getContentType(java.lang.String filename)
          Returns the content type of the specified file path.
static FileTypeMap getDefaultFileTypeMap()
          Returns the system default file type map.
static void setDefaultFileTypeMap(FileTypeMap map)
          Sets the default file type map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTypeMap

public FileTypeMap()
Method Detail

getDefaultFileTypeMap

public static FileTypeMap getDefaultFileTypeMap()
Returns the system default file type map. If one has not been set, this returns a MimetypesFileTypeMap.


setDefaultFileTypeMap

public static void setDefaultFileTypeMap(FileTypeMap map)
Sets the default file type map.

Parameters:
map - the new file type map

getContentType

public abstract java.lang.String getContentType(java.io.File file)
Returns the content type of the specified file.

Parameters:
file - the file to classify

getContentType

public abstract java.lang.String getContentType(java.lang.String filename)
Returns the content type of the specified file path.

Parameters:
filename - the path of the file to classify