Class UnixPath


  • public final class UnixPath
    extends java.lang.Object
    Class for manipulating Unix-like paths. Provides a standard way to add children to the paths so that we do not have to deal all the time with the path delimiters.
    • Method Detail

      • of

        public static UnixPath of​(java.lang.String... path)
      • fromString

        public static UnixPath fromString​(java.lang.String childPath)
      • isRoot

        public boolean isRoot()
      • getParent

        public java.util.Optional<UnixPath> getParent()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • addChild

        public UnixPath addChild​(java.lang.String childPath)
      • getLastPathElement

        public java.lang.String getLastPathElement()
      • getPathElementByIndexFromEnd

        public java.lang.String getPathElementByIndexFromEnd​(int index)
      • getFilename

        @Deprecated(since="getLastPathElement was introduced")
        public java.lang.String getFilename()
        Deprecated.
      • removeRoot

        public UnixPath removeRoot()
      • isEmptyPath

        public boolean isEmptyPath()