copy

abstract fun copy(fromPath: String, toPath: String): Path

Copies the file at the given fromPath to the given toPath.

Return

Path to the new file copy.

Parameters

fromPath

Relative path to the file that will be copied.

toPath

Relative path to where the file should be copied.

If this path includes subdirectories, those subdirectories will be created if they do not already exist.

Throws

if the file at fromPath does not exist.