Class Path

java.lang.Object
io.milton.common.Path
All Implemented Interfaces:
Serializable

public class Path extends Object implements Serializable
Immutable
See Also:
  • Field Details

  • Method Details

    • path

      public static Path path(Path parent, String path)
    • path

      public static Path path(String path)
    • getLength

      public int getLength()
    • getParts

      public String[] getParts()
    • getFirst

      public String getFirst()
      Returns:
      - the first part of the path. ie a/b/c returns a
    • getAfterFirst

      public List<String> getAfterFirst()
    • getStripFirst

      public Path getStripFirst()
    • getName

      public String getName()
    • getParent

      public Path getParent()
    • isRoot

      public boolean isRoot()
    • toPath

      public String toPath()
    • toString

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

      public String toString(String delimiter)
    • root

      public static Path root()
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • child

      public Path child(String name)
    • isRelative

      public boolean isRelative()
    • add

      public Path add(Path p)
      Add the path components of the given path to this one. Eg "a/b/c" + "/d/e/f" = "a/b/c/d/e/f"
      Parameters:
      p -
      Returns: