RelativePath

A relative hierarchical identifier that can be resolved against a path.

A relative path consists of a list of names, and each name is a non-empty byte string that doesn't contain the URI path separator /.

A relative path is an immutable data object independent of file systems, and can be converted to/from a byte string for presentation and serialization.

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val fileName: ByteString?

The file name of this relative path, which is the last name in the list of names.

Link copied to clipboard
val names: List<ByteString>

The list of names of this relative path.

Functions

Link copied to clipboard
open operator override fun compareTo(other: RelativePath): Int
Link copied to clipboard

Check whether this relative path ends with another relative path.

Link copied to clipboard

Get a relative path for the parent of this relative path, or null if this relative path is empty.

Link copied to clipboard

Get a relative path that is this relative path with redundant names removed.

Link copied to clipboard

Get a relative path between this relative path and another relative path.

Link copied to clipboard
fun resolve(fileName: ByteString): RelativePath

Resolve a file name against this relative path.

Resolve another relative path against this relative path.

Link copied to clipboard
fun resolveSibling(fileName: ByteString): RelativePath

Resolve a file name against the parent of this relative path.

Link copied to clipboard

Check whether this relative path starts with another relative path.

Link copied to clipboard
fun subPath(startIndex: Int, endIndex: Int): RelativePath

Get a relative path consisting of a sublist of names of this relative path.

Link copied to clipboard
fun toByteString(): ByteString

Get a bye string representing this relative path.

Link copied to clipboard
open override fun toString(): String