Class UnixPath

java.lang.Object
nva.commons.core.paths.UnixPath

public final class UnixPath extends 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.
  • Field Details

  • Method Details

    • of

      public static UnixPath of(String... path)
    • fromString

      public static UnixPath fromString(String childPath)
    • isRoot

      public boolean isRoot()
    • getParent

      public Optional<UnixPath> getParent()
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

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

      public UnixPath addChild(String childPath)
    • addChild

      public UnixPath addChild(UnixPath childPath)
    • getLastPathElement

      public String getLastPathElement()
    • getPathElementByIndexFromEnd

      public String getPathElementByIndexFromEnd(int index)
    • getFilename

      @Deprecated(since="getLastPathElement was introduced") public String getFilename()
      Deprecated.
    • addRoot

      public UnixPath addRoot()
    • removeRoot

      public UnixPath removeRoot()
    • isEmptyPath

      public boolean isEmptyPath()
    • replacePathElementByIndexFromEnd

      public UnixPath replacePathElementByIndexFromEnd(int index, String replacement)