relativize

abstract fun relativize(root: Path, path: Path): String?(source)

Computes the relative path from a root to a target path. It doesn't check if the paths actually exist in the filesystem.

Return

The relative path as a string, or null if the paths cannot be relativized (e.g., they have no common prefix).

Parameters

root

The root path.

path

The target path.