javax.activation
Class FileTypeMap
public abstract class FileTypeMap
Classifier for the MIME content type of files.
getContentType
public abstract String getContentType(File file)
Returns the content type of the specified file.
file
- the file to classify
getContentType
public abstract String getContentType(String filename)
Returns the content type of the specified file path.
filename
- the path of the file to classify
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.
map
- the new file type map