Class ShrinkWrapFileSystem

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

    public class ShrinkWrapFileSystem
    extends java.nio.file.FileSystem
    ShrinkWrap implementation adapting a Archive to a FileSystem; Thread-safe, though access to the underlying Archive is *not*.
    • Field Detail

      • FILE_ATTR_VIEW_BASIC

        static final java.lang.String FILE_ATTR_VIEW_BASIC
        Contracted name of the BasicFileAttributeView
        See Also:
        Constant Field Values
      • fileStores

        private final java.util.List<java.nio.file.FileStore> fileStores
      • open

        private volatile boolean open
        Whether or not this FS is open; volatile as we don't need compound operations and thus don't need full sync
    • Method Detail

      • provider

        public java.nio.file.spi.FileSystemProvider provider()
        Specified by:
        provider in class java.nio.file.FileSystem
        See Also:
        FileSystem.provider()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.nio.file.FileSystem
        Throws:
        java.io.IOException
        See Also:
        FileSystem.close()
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in class java.nio.file.FileSystem
        See Also:
        FileSystem.isOpen()
      • isReadOnly

        public boolean isReadOnly()
        Specified by:
        isReadOnly in class java.nio.file.FileSystem
        See Also:
        FileSystem.isReadOnly()
      • getSeparator

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

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

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

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

        public java.nio.file.Path getPath​(java.lang.String first,
                                          java.lang.String... more)
        Specified by:
        getPath in class java.nio.file.FileSystem
        See Also:
        FileSystem.getPath(java.lang.String, java.lang.String[])
      • merge

        private java.lang.String merge​(java.lang.String first,
                                       java.lang.String[] more)
        Merges the path context with a varargs String sub-contexts, returning the result
        Parameters:
        first -
        more -
        Returns:
      • getPathMatcher

        public java.nio.file.PathMatcher getPathMatcher​(java.lang.String syntaxAndPattern)
        Specified by:
        getPathMatcher in class java.nio.file.FileSystem
      • getUserPrincipalLookupService

        public java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService()
        Specified by:
        getUserPrincipalLookupService in class java.nio.file.FileSystem
        See Also:
        FileSystem.getUserPrincipalLookupService()
      • newWatchService

        public java.nio.file.WatchService newWatchService()
                                                   throws java.io.IOException
        Specified by:
        newWatchService in class java.nio.file.FileSystem
        Throws:
        java.io.IOException
        See Also:
        FileSystem.newWatchService()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • checkClosed

        private void checkClosed()
                          throws java.nio.file.ClosedFileSystemException
        Checks if the ShrinkWrapFileSystem is closed, and throws a ClosedFileSystemException if so
        Throws:
        java.nio.file.ClosedFileSystemException
      • getArchive

        Archive<?> getArchive()
        Obtains the underlying archive