FileSystem

interface FileSystem

A file system abstraction which can retrieve files, either absolutely or relative to a working directory.

Properties

Link copied to clipboard
open val isRoot: Boolean

Whether this file system is the root one.

Link copied to clipboard
abstract val root: FileSystem?

The root file system that originated this one via branch calls. If null, this file system is the root.

Link copied to clipboard
abstract val workingDirectory: File?

The working directory of this file system. If not null, resolve will be able to resolve relative paths from this directory.

Functions

Link copied to clipboard
abstract fun branch(workingDirectory: File?): FileSystem

Creates a new FileSystem branched from this one, with the given workingDirectory.

Link copied to clipboard
abstract fun relativePathTo(other: FileSystem): Path?

Computes the relative path from this file system's workingDirectory to other's.

Link copied to clipboard
abstract fun resolve(path: String): File

Resolves a local file path, either absolutely or relatively from workingDirectory. This does not perform any check for file existence.