javax.activation

Class FileTypeMap

public abstract class FileTypeMap extends Object

FileTypeMap is an abstract class that provides a data type interface for files.
Constructor Summary
FileTypeMap()
Method Summary
abstract StringgetContentType(File file)
abstract StringgetContentType(String filename)
static FileTypeMapgetDefaultFileTypeMap()
Returns the default FileTypeMap
static voidsetDefaultFileTypeMap(FileTypeMap fileMap)
Sets the default FileTypeMap for the system.

Constructor Detail

FileTypeMap

public FileTypeMap()

Method Detail

getContentType

public abstract String getContentType(File file)

getContentType

public abstract String getContentType(String filename)

getDefaultFileTypeMap

public static FileTypeMap getDefaultFileTypeMap()
Returns the default FileTypeMap

Returns: the default FileTYpeMap; if null returns a MimetypesFileTypeMap

setDefaultFileTypeMap

public static void setDefaultFileTypeMap(FileTypeMap fileMap)
Sets the default FileTypeMap for the system.

Parameters: fileMap the new default FileTypeMap

Throws: SecurityException if the caller does not have "SetFactory" RuntimePermission