Path type (joe.console)


A Java Path, i.e, the path to a file or a directory in the host file system.

Static Methods

Initializer

Methods

Static Methods


Path.compare()


Path.compare(a, b) → Number

Returns -1, 0, or 1 as a is less than, equal to, or greater than b when compared lexicographically.

Path Initializer


Path(first,[more...]) → Path

Creates a path from one or more string components.

Methods


path.endsWith()


path.endsWith(path) → Boolean

Returns true if this path ends with the given path. The path may be specified as a Path or a String.

path.getFileName()


path.getFileName() → Path

Returns the final path component, i.e., the name of the file or directory denoted by this path.

path.getName()


path.getName(index) → Path

Returns the path component at the given index.

path.getNameCount()


path.getNameCount() → Number

Returns the number of path components.

path.getParent()


path.getParent() → Path

Returns the parent of this path, or null if it doesn't have one.

path.isAbsolute()


path.isAbsolute() → Boolean

Returns true if the path is an absolute path, and false otherwise.

path.normalize()


path.normalize() → Path

Returns the path with redundant name elements eliminated.

path.relativize()


path.relativize(other) → Path

Returns a relative path from this path to the other path.

The other path may a Path or a String.

path.resolve()


path.resolve(other) → Path

Resolves the other path against this path, if other is relative, constructs a path starting with this path and continuing with the other. If other is absolute, it is returned unchanged.

The other path may a Path or a String.

path.startsWith()


path.startsWith(path) → Boolean

Returns true if this path starts with the given path. The path may be specified as a Path or a String.

path.subpath()


path.subpath(start, [end]) → Path

Returns the subpath of this path that starts at start and ends before end, which defaults to the end of the path.

path.toAbsolutePath()


path.toAbsolutePath() → Path

Converts the path into an absolute path.

path.toString()


path.toString() → String

Returns the path's string representation.