deleteExisting

JVM
JRE7
1.4
@ExperimentalPathApi fun Path.deleteExisting()

Deletes the existing file or empty directory specified by this path.

Exceptions

NoSuchFileException - if the file or directory does not exist.

DirectoryNotEmptyException - if the directory exists but is not empty.

See Also

Files.delete