Package org.apache.commons.vfs2.impl
Class FileTypeMap
java.lang.Object
org.apache.commons.vfs2.impl.FileTypeMap
A helper class that determines the provider to use for a file.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExtension
(String extension, String scheme) Adds a file name extension mapping.void
addMimeType
(String mimeType, String scheme) Adds a MIME type mapping.void
clear()
Removes all extensions and scheme mappings.getScheme
(FileObject fileObject) Gets the scheme for the provider of a layered file system.
-
Field Details
-
mimeTypeMap
-
extensionMap
-
-
Constructor Details
-
FileTypeMap
FileTypeMap()
-
-
Method Details
-
addExtension
Adds a file name extension mapping. -
addMimeType
Adds a MIME type mapping. -
clear
public void clear()Removes all extensions and scheme mappings. -
getScheme
Gets the scheme for the provider of a layered file system.This will check the
FileContentInfo
or file extension.- Parameters:
fileObject
- The file object to query.- Returns:
- Scheme supporting the file type or null (if unknown).
- Throws:
FileSystemException
- if an error occurs.
-