Class BasePath<T extends BasePath<T,​FS>,​FS extends BaseFileSystem<T>>

  • All Implemented Interfaces:
    java.lang.Comparable<java.nio.file.Path>, java.lang.Iterable<java.nio.file.Path>, java.nio.file.Path, java.nio.file.Watchable
    Direct Known Subclasses:
    RootedPath, SftpPath

    public abstract class BasePath<T extends BasePath<T,​FS>,​FS extends BaseFileSystem<T>>
    extends java.lang.Object
    implements java.nio.file.Path
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private FS fileSystem  
      private int hashValue  
      protected java.util.List<java.lang.String> names  
      protected java.lang.String root  
      private java.lang.String strValue  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BasePath​(FS fileSystem, java.lang.String root, java.util.List<java.lang.String> names)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String asString()  
      protected T asT()  
      protected int calculatedHashCode()  
      protected T checkPath​(java.nio.file.Path paramPath)  
      protected int compare​(java.lang.String s1, java.lang.String s2)  
      int compareTo​(java.nio.file.Path paramPath)  
      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 T create​(java.lang.String root, java.util.List<java.lang.String> names)  
      boolean endsWith​(java.lang.String other)  
      boolean endsWith​(java.nio.file.Path other)  
      protected boolean endsWith​(java.util.List<?> list, java.util.List<?> other)  
      boolean equals​(java.lang.Object obj)  
      T getFileName()  
      FS getFileSystem()  
      T getName​(int index)  
      int getNameCount()  
      T getParent()  
      T getRoot()  
      int hashCode()  
      boolean isAbsolute()  
      protected boolean isNormal()  
      java.util.Iterator<java.nio.file.Path> iterator()  
      T normalize()  
      java.nio.file.WatchKey register​(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events)  
      java.nio.file.WatchKey register​(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers)  
      T relativize​(java.nio.file.Path other)  
      T resolve​(java.lang.String other)  
      T resolve​(java.nio.file.Path other)  
      java.nio.file.Path resolveSibling​(java.lang.String other)  
      java.nio.file.Path resolveSibling​(java.nio.file.Path other)  
      boolean startsWith​(java.lang.String other)  
      boolean startsWith​(java.nio.file.Path other)  
      protected boolean startsWith​(java.util.List<?> list, java.util.List<?> other)  
      T subpath​(int beginIndex, int endIndex)  
      T toAbsolutePath()  
      java.io.File toFile()  
      java.lang.String toString()  
      java.net.URI toUri()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.nio.file.Path

        toRealPath
    • Field Detail

      • root

        protected final java.lang.String root
      • names

        protected final java.util.List<java.lang.String> names
      • strValue

        private java.lang.String strValue
      • hashValue

        private int hashValue
    • Constructor Detail

      • BasePath

        protected BasePath​(FS fileSystem,
                           java.lang.String root,
                           java.util.List<java.lang.String> names)
    • Method Detail

      • asT

        protected T asT()
      • 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 T create​(java.lang.String root,
                           java.util.List<java.lang.String> names)
      • getFileSystem

        public FS getFileSystem()
        Specified by:
        getFileSystem in interface java.nio.file.Path
      • isAbsolute

        public boolean isAbsolute()
        Specified by:
        isAbsolute in interface java.nio.file.Path
      • getRoot

        public T getRoot()
        Specified by:
        getRoot in interface java.nio.file.Path
      • getFileName

        public T getFileName()
        Specified by:
        getFileName in interface java.nio.file.Path
      • getParent

        public T getParent()
        Specified by:
        getParent in interface java.nio.file.Path
      • getNameCount

        public int getNameCount()
        Specified by:
        getNameCount in interface java.nio.file.Path
      • getName

        public T getName​(int index)
        Specified by:
        getName in interface java.nio.file.Path
      • subpath

        public T subpath​(int beginIndex,
                         int endIndex)
        Specified by:
        subpath in interface java.nio.file.Path
      • startsWith

        protected boolean startsWith​(java.util.List<?> list,
                                     java.util.List<?> other)
      • startsWith

        public boolean startsWith​(java.nio.file.Path other)
        Specified by:
        startsWith in interface java.nio.file.Path
      • startsWith

        public boolean startsWith​(java.lang.String other)
        Specified by:
        startsWith in interface java.nio.file.Path
      • endsWith

        protected boolean endsWith​(java.util.List<?> list,
                                   java.util.List<?> other)
      • endsWith

        public boolean endsWith​(java.nio.file.Path other)
        Specified by:
        endsWith in interface java.nio.file.Path
      • endsWith

        public boolean endsWith​(java.lang.String other)
        Specified by:
        endsWith in interface java.nio.file.Path
      • isNormal

        protected boolean isNormal()
      • normalize

        public T normalize()
        Specified by:
        normalize in interface java.nio.file.Path
      • resolve

        public T resolve​(java.nio.file.Path other)
        Specified by:
        resolve in interface java.nio.file.Path
      • resolve

        public T resolve​(java.lang.String other)
        Specified by:
        resolve in interface java.nio.file.Path
      • resolveSibling

        public java.nio.file.Path resolveSibling​(java.nio.file.Path other)
        Specified by:
        resolveSibling in interface java.nio.file.Path
      • resolveSibling

        public java.nio.file.Path resolveSibling​(java.lang.String other)
        Specified by:
        resolveSibling in interface java.nio.file.Path
      • relativize

        public T relativize​(java.nio.file.Path other)
        Specified by:
        relativize in interface java.nio.file.Path
      • toAbsolutePath

        public T toAbsolutePath()
        Specified by:
        toAbsolutePath in interface java.nio.file.Path
      • toUri

        public java.net.URI toUri()
        Specified by:
        toUri in interface java.nio.file.Path
      • toFile

        public java.io.File toFile()
        Specified by:
        toFile in interface java.nio.file.Path
      • register

        public java.nio.file.WatchKey register​(java.nio.file.WatchService watcher,
                                               java.nio.file.WatchEvent.Kind<?>... events)
                                        throws java.io.IOException
        Specified by:
        register in interface java.nio.file.Path
        Specified by:
        register in interface java.nio.file.Watchable
        Throws:
        java.io.IOException
      • register

        public java.nio.file.WatchKey register​(java.nio.file.WatchService watcher,
                                               java.nio.file.WatchEvent.Kind<?>[] events,
                                               java.nio.file.WatchEvent.Modifier... modifiers)
                                        throws java.io.IOException
        Specified by:
        register in interface java.nio.file.Path
        Specified by:
        register in interface java.nio.file.Watchable
        Throws:
        java.io.IOException
      • iterator

        public java.util.Iterator<java.nio.file.Path> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T extends BasePath<T,​FS>>
        Specified by:
        iterator in interface java.nio.file.Path
      • compareTo

        public int compareTo​(java.nio.file.Path paramPath)
        Specified by:
        compareTo in interface java.lang.Comparable<T extends BasePath<T,​FS>>
        Specified by:
        compareTo in interface java.nio.file.Path
      • compare

        protected int compare​(java.lang.String s1,
                              java.lang.String s2)
      • checkPath

        protected T checkPath​(java.nio.file.Path paramPath)
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.nio.file.Path
        Overrides:
        hashCode in class java.lang.Object
      • calculatedHashCode

        protected int calculatedHashCode()
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.nio.file.Path
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.nio.file.Path
        Overrides:
        toString in class java.lang.Object
      • asString

        protected java.lang.String asString()