Class FileTypeMap

java.lang.Object
org.apache.commons.vfs2.impl.FileTypeMap

final class FileTypeMap extends Object
A helper class that determines the provider to use for a file.
  • Field Details

  • Constructor Details

    • FileTypeMap

      FileTypeMap()
  • Method Details

    • addExtension

      public void addExtension(String extension, String scheme)
      Adds a file name extension mapping.
    • addMimeType

      public void addMimeType(String mimeType, String scheme)
      Adds a MIME type mapping.
    • clear

      public void clear()
      Removes all extensions and scheme mappings.
    • getScheme

      public String getScheme(FileObject fileObject) throws FileSystemException
      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.