Path

Node API: Path

Describes a "path object," as specified by the Node.js "Path" built-in module. Path objects carry information about a parsed path, or allow the user to specify path information in a structured way. Certain methods in the Path API can accept an object of this type.

Inheritors

Types

Link copied to clipboard

Defines methods for creating paths from various primitive values, including String instances, and Kotlin and Java standard path types.

Properties

Link copied to clipboard
abstract val base: String

Describes the "basename" of the desired path, which is the combined portion of the file name and file extension. If this property (base) is specified, name and ext are used instead.

Link copied to clipboard
abstract val dir: String

Holds the base directory, or directory prefix, which is applied to the rendered path; if dir is specified, any present value for root is ignored.

Link copied to clipboard
abstract val ext: String

Describes the file extension to be used or which is present for the path; if specified, name is also consulted, and any present value for base is ignored.

Link copied to clipboard
abstract val isAbsolute: Boolean

Determine if the underlying path is an absolute expression of the path segments.

Link copied to clipboard
abstract val length: Int
Link copied to clipboard
abstract val name: String

Describes the naked "name" of the file, without any file extension; if specified, ext is also consulted, and any value for base is ignored.

Link copied to clipboard
abstract val root: String

Holds the root directory, if any, of the path. Only one of root or dir may be specified; if both are provided, dir wins.

Link copied to clipboard
abstract val style: PathStyle

Describes the style of the path, which is used to determine how the path is rendered.

Functions

Link copied to clipboard
abstract operator fun compareTo(other: Path): Int
Link copied to clipboard
abstract fun copy(): Path

Creates a new path object with the same properties as this one.

Link copied to clipboard
abstract operator fun get(index: Int): Char
Link copied to clipboard
abstract fun join(vararg paths: Path): String
abstract fun join(other: Iterable<String>): String
abstract fun join(first: String, vararg rest: String): String

Join this path by the delimiter for this path type with another path, yielding a path composed of both.

Link copied to clipboard
abstract fun split(): Sequence<String>

Split this path by the delimiter for this path type, yielding each string section as a sequence entry.

Link copied to clipboard
abstract fun subSequence(startIndex: Int, endIndex: Int): CharSequence
Link copied to clipboard
abstract fun toJavaPath(): Path

Utility to convert this Node-style path to a Java path.

Link copied to clipboard
abstract fun toKotlinPath(): Path

Utility to convert this Node-style path to a Kotlin path.