Class VirtFSProvider

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.net.URI,​VirtFS> filesystems  
      protected static org.slf4j.Logger logger  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected VirtFSProvider()  
    • Method Summary

      Modifier and Type Method Description
      void checkAccess​(java.nio.file.Path path, java.nio.file.AccessMode... modes)  
      void copy​(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)  
      void createDirectory​(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)  
      void delete​(java.nio.file.Path path)  
      static VirtFSProvider get()  
      protected java.nio.file.Path getContainerPath​(java.nio.file.Path path)  
      <V extends java.nio.file.attribute.FileAttributeView>
      V
      getFileAttributeView​(java.nio.file.Path path, java.lang.Class<V> type, java.nio.file.LinkOption... options)  
      java.nio.file.FileStore getFileStore​(java.nio.file.Path path)  
      java.nio.file.FileSystem getFileSystem​(java.net.URI uri)  
      java.nio.file.Path getPath​(java.net.URI uri)
      java.lang.String getScheme()  
      boolean isHidden​(java.nio.file.Path path)  
      boolean isSameFile​(java.nio.file.Path path, java.nio.file.Path path2)  
      void move​(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)  
      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​(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)  
      java.nio.file.FileSystem newFileSystem​(java.net.URI uri, java.util.Map<java.lang.String,​?> env)  
      <A extends java.nio.file.attribute.BasicFileAttributes>
      A
      readAttributes​(java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options)  
      java.util.Map<java.lang.String,​java.lang.Object> readAttributes​(java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption... options)  
      void setAttribute​(java.nio.file.Path path, java.lang.String attribute, java.lang.Object value, java.nio.file.LinkOption... options)  
      • Methods inherited from class java.nio.file.spi.FileSystemProvider

        createLink, createSymbolicLink, deleteIfExists, installedProviders, newAsynchronousFileChannel, newFileSystem, newInputStream, newOutputStream, readSymbolicLink
      • Methods inherited from class java.lang.Object

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

      • logger

        protected static final org.slf4j.Logger logger
      • filesystems

        protected java.util.Map<java.net.URI,​VirtFS> filesystems
    • Constructor Detail

      • VirtFSProvider

        protected VirtFSProvider()
    • Method Detail

      • newFileSystem

        public java.nio.file.FileSystem newFileSystem​(java.net.URI uri,
                                                      java.util.Map<java.lang.String,​?> env)
                                               throws java.io.IOException
        Overrides:
        newFileSystem in class MetaFSProvider
        Throws:
        java.io.IOException
      • getFileSystem

        public java.nio.file.FileSystem getFileSystem​(java.net.URI uri)
        Overrides:
        getFileSystem in class MetaFSProvider
      • getPath

        public java.nio.file.Path getPath​(java.net.URI uri)

        Meta Details

        Although this is a meta FS, and the URIs are essentially symbolic, we still enforce that the logical nesting of a filesystem URI and a path URI will determine when this method will return a valid value. In other words, a path will not be returned for a meta file system wherein the URI of that file system does not logical contain the inner path. This should maintain important semantics about usage and filtering that developers may take for granted.

        Overrides:
        getPath in class MetaFSProvider
      • 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
        Overrides:
        newByteChannel in class MetaFSProvider
        Throws:
        java.io.IOException
      • createDirectory

        public void createDirectory​(java.nio.file.Path dir,
                                    java.nio.file.attribute.FileAttribute<?>... attrs)
                             throws java.io.IOException
        Overrides:
        createDirectory in class MetaFSProvider
        Throws:
        java.io.IOException
      • delete

        public void delete​(java.nio.file.Path path)
                    throws java.io.IOException
        Overrides:
        delete in class MetaFSProvider
        Throws:
        java.io.IOException
      • copy

        public void copy​(java.nio.file.Path source,
                         java.nio.file.Path target,
                         java.nio.file.CopyOption... options)
                  throws java.io.IOException
        Overrides:
        copy in class MetaFSProvider
        Throws:
        java.io.IOException
      • move

        public void move​(java.nio.file.Path source,
                         java.nio.file.Path target,
                         java.nio.file.CopyOption... options)
                  throws java.io.IOException
        Overrides:
        move in class MetaFSProvider
        Throws:
        java.io.IOException
      • isSameFile

        public boolean isSameFile​(java.nio.file.Path path,
                                  java.nio.file.Path path2)
                           throws java.io.IOException
        Overrides:
        isSameFile in class MetaFSProvider
        Throws:
        java.io.IOException
      • isHidden

        public boolean isHidden​(java.nio.file.Path path)
                         throws java.io.IOException
        Overrides:
        isHidden in class MetaFSProvider
        Throws:
        java.io.IOException
      • getFileStore

        public java.nio.file.FileStore getFileStore​(java.nio.file.Path path)
                                             throws java.io.IOException
        Overrides:
        getFileStore in class MetaFSProvider
        Throws:
        java.io.IOException
      • checkAccess

        public void checkAccess​(java.nio.file.Path path,
                                java.nio.file.AccessMode... modes)
                         throws java.io.IOException
        Overrides:
        checkAccess in class MetaFSProvider
        Throws:
        java.io.IOException
      • getFileAttributeView

        public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView​(java.nio.file.Path path,
                                                                                            java.lang.Class<V> type,
                                                                                            java.nio.file.LinkOption... options)
        Overrides:
        getFileAttributeView in class MetaFSProvider
      • readAttributes

        public <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes​(java.nio.file.Path path,
                                                                                        java.lang.Class<A> type,
                                                                                        java.nio.file.LinkOption... options)
                                                                                 throws java.io.IOException
        Overrides:
        readAttributes in class MetaFSProvider
        Throws:
        java.io.IOException
      • readAttributes

        public 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
        Overrides:
        readAttributes in class MetaFSProvider
        Throws:
        java.io.IOException
      • setAttribute

        public void setAttribute​(java.nio.file.Path path,
                                 java.lang.String attribute,
                                 java.lang.Object value,
                                 java.nio.file.LinkOption... options)
                          throws java.io.IOException
        Overrides:
        setAttribute in class MetaFSProvider
        Throws:
        java.io.IOException
      • getContainerPath

        protected java.nio.file.Path getContainerPath​(java.nio.file.Path path)
      • newDirectoryStream

        public java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream​(java.nio.file.Path dir,
                                                                                    java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
                                                                             throws java.io.IOException
        Overrides:
        newDirectoryStream in class MetaFSProvider
        Throws:
        java.io.IOException