Class Ec4jPath.Ec4jPaths.NioPath

java.lang.Object
org.ec4j.core.model.Ec4jPath.Ec4jPaths.NioPath
All Implemented Interfaces:
Adaptable, Ec4jPath
Enclosing class:
Ec4jPath.Ec4jPaths

static class Ec4jPath.Ec4jPaths.NioPath extends Object implements Ec4jPath
An Ec4jPath based on Path.
  • Field Details

    • isWindows

      private static final boolean isWindows
    • path

      private final Path path
    • toString

      private String toString
  • Constructor Details

    • NioPath

      NioPath(Path path)
  • Method Details

    • equals

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

      public String getLastSegment()
      Specified by:
      getLastSegment in interface Ec4jPath
      Returns:
      the last segment of this Ec4jPath
    • getParentPath

      public Ec4jPath getParentPath()
      Specified by:
      getParentPath in interface Ec4jPath
      Returns:
      the parent path of this Ec4jPath or null of this Ec4jPath has no parent
    • hashCode

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

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

      public 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.
      Specified by:
      relativize in interface Ec4jPath
      Parameters:
      other - the path to relativize
      Returns:
      a relative path between this path and a given path.
    • resolve

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

      public String toString()
      Specified by:
      toString in interface Ec4jPath
      Overrides:
      toString in class Object
      Returns:
      a String representation of this Ec4jPath delimited by slash /
    • getAdapter

      public <T> T getAdapter(Class<T> type)
      Description copied from interface: Adaptable
      Returns this adapted as an object of the given type or null if adapting to a given type is not possible.

      Can be used to give callers an access to some underlying representation of this, such as Path for a Path-based implementation of Ec4jPath.

      The set of supported types is implementation specific.

      Specified by:
      getAdapter in interface Adaptable
      Type Parameters:
      T - the type to get an adapter for
      Parameters:
      type - the type of the adapter to lookup
      Returns:
      the adapter of the given type or null if an adapter for the given type is not available