Class BaseFileSystem<T extends java.nio.file.Path>

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

    public abstract class BaseFileSystem<T extends java.nio.file.Path>
    extends java.nio.file.FileSystem
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.file.spi.FileSystemProvider fileSystemProvider  
      protected org.slf4j.Logger log  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BaseFileSystem​(java.nio.file.spi.FileSystemProvider fileSystemProvider)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void appendDedupSep​(java.lang.StringBuilder sb, java.lang.CharSequence s)  
      protected T create​(java.lang.String root, java.lang.String... names)  
      protected T create​(java.lang.String root, java.util.Collection<java.lang.String> names)  
      protected abstract T create​(java.lang.String root, java.util.List<java.lang.String> names)  
      T getDefaultDir()  
      java.lang.Iterable<java.nio.file.FileStore> getFileStores()  
      T 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()  
      protected java.lang.String globToRegex​(java.lang.String pattern)  
      protected java.lang.String handleWindowsSeparator​(java.lang.String name)
      In case we are running on Windows, accept "\\" as a file separator.
      protected boolean hostFsHasWindowsSeparator()  
      boolean isReadOnly()  
      java.nio.file.WatchService newWatchService()  
      java.nio.file.spi.FileSystemProvider provider()  
      • Methods inherited from class java.nio.file.FileSystem

        close, getUserPrincipalLookupService, isOpen, supportedFileAttributeViews
      • Methods inherited from class java.lang.Object

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

      • log

        protected final org.slf4j.Logger log
      • fileSystemProvider

        private final java.nio.file.spi.FileSystemProvider fileSystemProvider
    • Constructor Detail

      • BaseFileSystem

        protected BaseFileSystem​(java.nio.file.spi.FileSystemProvider fileSystemProvider)
    • Method Detail

      • getDefaultDir

        public T getDefaultDir()
      • isReadOnly

        public boolean isReadOnly()
        Specified by:
        isReadOnly in class java.nio.file.FileSystem
      • 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
      • getPath

        public T getPath​(java.lang.String first,
                         java.lang.String... more)
        Specified by:
        getPath in class java.nio.file.FileSystem
      • appendDedupSep

        protected void appendDedupSep​(java.lang.StringBuilder sb,
                                      java.lang.CharSequence s)
      • handleWindowsSeparator

        protected java.lang.String handleWindowsSeparator​(java.lang.String name)
        In case we are running on Windows, accept "\\" as a file separator. Ignore in *nix as "\\" is a valid filename
        Parameters:
        name - the name to fix the separator for if running on Windows
        Returns:
        the fixed name
      • hostFsHasWindowsSeparator

        protected boolean hostFsHasWindowsSeparator()
      • getPathMatcher

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

        protected java.lang.String globToRegex​(java.lang.String pattern)
      • newWatchService

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

        protected T create​(java.lang.String root,
                           java.lang.String... names)
      • create

        protected T create​(java.lang.String root,
                           java.util.Collection<java.lang.String> names)
      • create

        protected abstract T create​(java.lang.String root,
                                    java.util.List<java.lang.String> names)