Class AbsolutePath

java.lang.Object
de.tomatengames.util.io.AbsolutePath

public class AbsolutePath extends Object
An AbsolutePath represents an absolute and direct Path. See AbsoluteFile for usage with Files.
Since:
1.6
  • Method Details

    • get

      public static AbsolutePath get(String path)
      Returns an AbsolutePath that represents the absolute and direct equivalent Path.
      Parameters:
      path - the input path name
      Returns:
      the AbsolutePath of the specified path
    • get

      public static AbsolutePath get(Path path)
      Returns an AbsolutePath that represents the absolute and direct equivalent Path.
      Parameters:
      path - the input Path
      Returns:
      the AbsolutePath of the specified path
    • getPath

      public Path getPath()
      Returns this AbsolutePath as a Path. It is absolute and direct/normalized.
      Returns:
      the Path
    • toString

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

      public boolean contains(AbsolutePath path)
      contains(AbsolutePath, boolean) with allowSame=false.
      Parameters:
      path - the path
      Returns:
      whether the specified path is inside this path
    • contains

      public boolean contains(AbsolutePath path, boolean allowSame)
      Returns whether the specified path is inside this path.
      Parameters:
      path - the path
      allowSame - whether to return true if the specified path equals this path
      Returns:
      whether the specified path is inside this path.
    • resolveInside

      public AbsolutePath resolveInside(String subpath)
      Returns the path inside this path resolved from the specified subpath.
      Parameters:
      subpath - the subpath to resolve
      Returns:
      the resolved path
      Throws:
      InvalidPathException - if the resolved path is not inside this path
      See Also:
    • resolveInside

      public AbsolutePath resolveInside(String subpath, boolean allowSame)
      Returns the path inside this path resolved from the specified subpath.
      Parameters:
      subpath - the subpath to resolve
      allowSame - whether to accept the resolved path if it equals this path
      Returns:
      the resolved path
      Throws:
      InvalidPathException - if the resolved path is not inside this path
      See Also: