# Path

open class Path : Comparable<T> (source)

Represents a path in Gradle.

## Properties

ROOT
Link copied to clipboard
val ROOT: Path
SEPARATOR
Link copied to clipboard
val SEPARATOR: String = ":"

## Functions

absolutePath
Link copied to clipboard
open fun absolutePath(path: String): String
Resolves the given name relative to this path.
open fun absolutePath(path: Path): Path
append
Link copied to clipboard
open fun append(path: Path): Path
Appends the supplied path to this path, returning the new path.
child
Link copied to clipboard
open fun child(name: String): Path
Creates a child of this path with the given name.
compareTo
Link copied to clipboard
open fun compareTo(other: Path): Int
equals
Link copied to clipboard
open fun equals(@Nullable o: Any): Boolean
getName
Link copied to clipboard
@Nullable
open fun getName(): String
Returns the base name of this path, or null if this path is the root path.
getParent
Link copied to clipboard
@Nullable
open fun getParent(): Path
Returns the parent of this path, or null if this path has no parent.
getPath
Link copied to clipboard
open fun getPath(): String
hashCode
Link copied to clipboard
open fun hashCode(): Int
isAbsolute
Link copied to clipboard
open fun isAbsolute(): Boolean
path
Link copied to clipboard
open fun path(@Nullable path: String): Path
relativePath
Link copied to clipboard
open fun relativePath(path: String): String
Calculates a path relative to this path.
open fun relativePath(path: Path): Path
removeFirstSegments
Link copied to clipboard
open fun removeFirstSegments(n: Int): Path
segment
Link copied to clipboard
open fun segment(index: Int): String
segmentCount
Link copied to clipboard
open fun segmentCount(): Int
segments
Link copied to clipboard
@Incubating
open fun segments(): List<String>
returns an immutable list of the segments of this path
takeFirstSegments
Link copied to clipboard
@Incubating
open fun takeFirstSegments(n: Int): Path
Returns a `Path` containing only the first `n` segments of this `Path`.
toString
Link copied to clipboard
open fun toString(): String
validatePath
Link copied to clipboard
@Incubating
open fun validatePath(@Nullable path: String)
throws if no path is specified