Home » Open-JDK-6.b17-src » javax » activation » [javadoc | source]
javax.activation
abstract public class: FileTypeMap [javadoc | source]
java.lang.Object
   javax.activation.FileTypeMap

Direct Known Subclasses:
    MimetypesFileTypeMap

The FileTypeMap is an abstract class that provides a data typing interface for files. Implementations of this class will implement the getContentType methods which will derive a content type from a file name or a File object. FileTypeMaps could use any scheme to determine the data type, from examining the file extension of a file (like the MimetypesFileTypeMap) to opening the file and trying to derive its type from the contents of the file. The FileDataSource class uses the default FileTypeMap (a MimetypesFileTypeMap unless changed) to determine the content type of files.
Constructor:
 public FileTypeMap() 
Method from javax.activation.FileTypeMap Summary:
getContentType,   getContentType,   getDefaultFileTypeMap,   setDefaultFileTypeMap
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.activation.FileTypeMap Detail:
 abstract public String getContentType(File file)
    Return the type of the file object. This method should always return a valid MIME type.
 abstract public String getContentType(String filename)
    Return the type of the file passed in. This method should always return a valid MIME type.
 public static FileTypeMap getDefaultFileTypeMap() 
    Return the default FileTypeMap for the system. If setDefaultFileTypeMap was called, return that instance, otherwise return an instance of MimetypesFileTypeMap.
 public static  void setDefaultFileTypeMap(FileTypeMap map) 
    Sets the default FileTypeMap for the system. This instance will be returned to callers of getDefaultFileTypeMap.