Class AbstractFileProvider

    • Constructor Detail

      • AbstractFileProvider

        public AbstractFileProvider()
    • Method Detail

      • setFileNameParser

        protected void setFileNameParser​(FileNameParser parser)
      • close

        public void close()
        Closes the file systems created by this provider.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface VfsComponent
        Overrides:
        close in class AbstractVfsContainer
      • createFileSystem

        public FileObject createFileSystem​(java.lang.String scheme,
                                           FileObject file,
                                           FileSystemOptions fileSystemOptions)
                                    throws FileSystemException
        Creates a layered file system. This method throws a 'not supported' exception.
        Specified by:
        createFileSystem in interface FileProvider
        Parameters:
        scheme - The protocol to use to access the file.
        file - a FileObject.
        fileSystemOptions - Options to the file system.
        Returns:
        A FileObject associated with the new FileSystem.
        Throws:
        FileSystemException - if an error occurs.
      • addFileSystem

        protected void addFileSystem​(java.lang.Comparable<?> key,
                                     FileSystem fs)
                              throws FileSystemException
        Adds a file system to those cached by this provider.

        The file system may implement VfsComponent, in which case it is initialized.

        Parameters:
        key - The root file of the file system, part of the cache key.
        fs - the file system to add.
        Throws:
        FileSystemException - if any error occurs.
      • findFileSystem

        protected FileSystem findFileSystem​(java.lang.Comparable<?> key,
                                            FileSystemOptions fileSystemOptions)
        Locates a cached file system.
        Parameters:
        key - The root file of the file system, part of the cache key.
        fileSystemOptions - file system options the file system instance must have, may be null.
        Returns:
        The file system instance, or null if it is not cached.
      • freeUnusedResources

        public void freeUnusedResources()
        Free unused resources.
      • closeFileSystem

        public void closeFileSystem​(FileSystem fileSystem)
        Close the FileSystem.
        Parameters:
        fileSystem - The FileSystem to close.