Interface Ec4jPath

All Superinterfaces:
Adaptable
All Known Implementing Classes:
Ec4jPath.Ec4jPaths.NioPath, Ec4jPath.Ec4jPaths.StringPath

public interface Ec4jPath extends Adaptable
A path in a tree of resources. An Ec4jPath consists of segments. When an Ec4jPath is rendered as a String, the segments are delimited by a slash /.
  • Method Details

    • getLastSegment

      String getLastSegment()
      Returns:
      the last segment of this Ec4jPath
    • getParentPath

      Ec4jPath getParentPath()
      Returns:
      the parent path of this Ec4jPath or null of this Ec4jPath has no parent
    • isAbsolute

      boolean isAbsolute()
      Returns:
      true if this Ec4jPath is absolute (i.e. starting with a slash / or any other implementation specific way) or false otherwise
    • relativize

      Ec4jPath relativize(Ec4jPath other)
      Constructs a relative path between this path and the given Ec4jPath. If this Ec4jPath is /dir1 and other is /dir1/dir2/file then the relative path is dir2/file.
      Parameters:
      other - the path to relativize
      Returns:
      a relative path between this path and a given path.
    • resolve

      Ec4jPath resolve(String segment)
      Creates a new Ec4jPath by appending the given segment to this Ec4jPath.
      Parameters:
      segment - the segment to append to this Ec4jPath
      Returns:
      a new Ec4jPath
    • toString

      String toString()
      Overrides:
      toString in class Object
      Returns:
      a String representation of this Ec4jPath delimited by slash /