Class LayerFS

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class LayerFS
    extends MetaFS
    This filesystem is a filesystem aggregator, allowing users to provide layered views of existing filesystems. The URI is merely symbolic in this filesystem, since the user must endRenderers any wrapped filesystems separately from the call to FileSystemProvider.newFileSystem(URI, Map).

    Meta Details

    In general, operations are attempted on each filesystem, each with a path scoped to that filesystem instance, until the operation succeeds without throwing an error.

    For operations which specify read-specific or write-specific options, any read-only filesystems are skipped when write mode is requested. By default, filesystems are registered as readonly, providing some default safety.

    • Field Summary

    • Constructor Summary

      Constructors 
      Constructor Description
      LayerFS​(java.lang.String name)  
    • Constructor Detail

      • LayerFS

        public LayerFS​(java.lang.String name)
    • Method Detail

      • setWritable

        public LayerFS setWritable​(boolean writable)
      • addLayer

        public LayerFS addLayer​(java.nio.file.Path outerPath,
                                java.lang.String pathSymbolicName)
      • addLayer

        public LayerFS addLayer​(java.nio.file.FileSystem fileSystem)
      • getRootDirectories

        public java.lang.Iterable<java.nio.file.Path> getRootDirectories()
        Specified by:
        getRootDirectories in class java.nio.file.FileSystem
      • provider

        public LayerFSProvider provider()
        Specified by:
        provider in class java.nio.file.FileSystem
      • getSeparator

        public java.lang.String getSeparator()
        Specified by:
        getSeparator in class java.nio.file.FileSystem
      • getFileStores

        public java.lang.Iterable<java.nio.file.FileStore> getFileStores()
        Specified by:
        getFileStores in class java.nio.file.FileSystem
      • supportedFileAttributeViews

        public java.util.Set<java.lang.String> supportedFileAttributeViews()
        Specified by:
        supportedFileAttributeViews in class java.nio.file.FileSystem
      • getPath

        public java.nio.file.Path getPath​(java.lang.String first,
                                          java.lang.String... more)
        Overrides:
        getPath in class MetaFS
      • newByteChannel

        public java.nio.channels.SeekableByteChannel newByteChannel​(java.nio.file.Path path,
                                                                    java.util.Set<? extends java.nio.file.OpenOption> options,
                                                                    java.nio.file.attribute.FileAttribute<?>... attrs)
                                                             throws java.io.IOException
        Specified by:
        newByteChannel in class MetaFS
        Throws:
        java.io.IOException
      • getName

        public java.lang.String getName()
        Specified by:
        getName in class MetaFS
      • getPathMatcher

        public java.nio.file.PathMatcher getPathMatcher​(java.lang.String syntaxAndPattern)
        Overrides:
        getPathMatcher in class MetaFS
      • getUserPrincipalLookupService

        public java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService()
        Overrides:
        getUserPrincipalLookupService in class MetaFS
      • newWatchService

        public java.nio.file.WatchService newWatchService()
                                                   throws java.io.IOException
        Overrides:
        newWatchService in class MetaFS
        Throws:
        java.io.IOException
      • getWrappedFilesystems

        public java.util.List<java.nio.file.FileSystem> getWrappedFilesystems()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class MetaFS
      • checkAccess

        public void checkAccess​(java.nio.file.Path path,
                                java.nio.file.AccessMode... modes)
                         throws java.io.IOException
        Description copied from class: MetaFS
        This should be implemented per filesystem, using the signature of FileSystemProvider.checkAccess(Path, AccessMode[])
        Overrides:
        checkAccess in class MetaFS
        Throws:
        java.io.IOException