Class VirtFS

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    RenderFS

    public class VirtFS
    extends MetaFS
    This MetaFS filesystem type simply virtualizes a root directory behind a filesystem interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      VirtFS​(java.nio.file.Path outerPath, java.lang.String name)  
    • Method Summary

      Modifier and Type Method Description
      void checkAccess​(java.nio.file.Path path, java.nio.file.AccessMode[] modes)
      This should be implemented per filesystem, using the signature of FileSystemProvider.checkAccess(Path, AccessMode[])
      java.nio.file.attribute.FileAttributeView getFileAttributeView​(java.nio.file.Path path, java.lang.Class type, java.nio.file.LinkOption... options)  
      java.lang.Iterable<java.nio.file.FileStore> getFileStores()  
      java.lang.String getName()  
      protected java.nio.file.Path getOuterMount()  
      java.nio.file.Path getPath​(java.lang.String first, java.lang.String... more)  
      java.nio.file.PathMatcher getPathMatcher​(java.lang.String syntaxAndPattern)  
      java.lang.Iterable<java.nio.file.Path> getRootDirectories()  
      java.lang.String getSeparator()  
      java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService()  
      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)  
      java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream​(MetaPath metapath, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)  
      java.nio.file.WatchService newWatchService()  
      java.nio.file.spi.FileSystemProvider provider()  
      protected java.nio.file.attribute.BasicFileAttributes readAttributes​(java.nio.file.Path path, java.lang.Class<java.nio.file.attribute.BasicFileAttributes> type, java.nio.file.LinkOption[] options)  
      protected java.util.Map<java.lang.String,​java.lang.Object> readAttributes​(java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption[] options)  
      VirtFS setSysDefaultPath​(java.nio.file.Path sysDefaultPath)  
      java.util.Set<java.lang.String> supportedFileAttributeViews()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
      • metaToSysFunc

        public final java.util.function.Function<MetaPath,​java.nio.file.Path> metaToSysFunc
      • sysToMetaFunc

        public final java.util.function.Function<java.nio.file.Path,​MetaPath> sysToMetaFunc
    • Constructor Detail

      • VirtFS

        public VirtFS​(java.nio.file.Path outerPath,
                      java.lang.String name)
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName 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
      • setSysDefaultPath

        public VirtFS setSysDefaultPath​(java.nio.file.Path sysDefaultPath)
      • provider

        public java.nio.file.spi.FileSystemProvider 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
      • getRootDirectories

        public java.lang.Iterable<java.nio.file.Path> getRootDirectories()
        Specified by:
        getRootDirectories 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
      • 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
      • toString

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

        protected java.nio.file.attribute.BasicFileAttributes readAttributes​(java.nio.file.Path path,
                                                                             java.lang.Class<java.nio.file.attribute.BasicFileAttributes> type,
                                                                             java.nio.file.LinkOption[] options)
                                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • readAttributes

        protected java.util.Map<java.lang.String,​java.lang.Object> readAttributes​(java.nio.file.Path path,
                                                                                        java.lang.String attributes,
                                                                                        java.nio.file.LinkOption[] options)
                                                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • getFileAttributeView

        public java.nio.file.attribute.FileAttributeView getFileAttributeView​(java.nio.file.Path path,
                                                                              java.lang.Class type,
                                                                              java.nio.file.LinkOption... options)
      • newDirectoryStream

        public java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream​(MetaPath metapath,
                                                                                    java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • 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
      • getOuterMount

        protected java.nio.file.Path getOuterMount()