public abstract class FileTypeMap
extends java.lang.Object
FileTypeMap
,
FileDataSource
,
MimetypesFileTypeMap
Constructor and Description |
---|
FileTypeMap()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getContentType(java.io.File file)
Return the type of the file object.
|
abstract java.lang.String |
getContentType(java.lang.String filename)
Return the type of the file passed in.
|
static FileTypeMap |
getDefaultFileTypeMap()
Return the default FileTypeMap for the system.
|
static void |
setDefaultFileTypeMap(FileTypeMap fileTypeMap)
Sets the default FileTypeMap for the system.
|
public abstract java.lang.String getContentType(java.io.File file)
file
- A file to be typed.public abstract java.lang.String getContentType(java.lang.String filename)
filename
- the pathname of the file.public static void setDefaultFileTypeMap(FileTypeMap fileTypeMap)
fileTypeMap
- The FileTypeMap.java.lang.SecurityException
- if the caller doesn't have permission
to change the defaultpublic static FileTypeMap getDefaultFileTypeMap()
MimetypesFileTypeMap
.setDefaultFileTypeMap(jakarta.activation.FileTypeMap)