class Files
(source)
Utility methods for working with files.
static fun atomicReplace(path: Path, bytes: ByteArray): Unit static fun atomicReplace(path: Path, fn: IOConsumer<Writer>): Unit static fun atomicReplace(path: Path, charset: Charset, fn: IOConsumer<Writer>): Unit
Write a temporary file and then replace target. |
|
static fun copyResource(resourceName: String, destination: Path, vararg options: OpenOption): Path static fun copyResource(classloader: ClassLoader, resourceName: String, destination: Path, vararg options: OpenOption): Path
Copies the content of a resource to a file. static fun copyResource(resourceName: String, out: OutputStream): Long static fun copyResource(classloader: ClassLoader, resourceName: String, out: OutputStream): Long
Copies the content of a resource to an output stream. |
|
static fun createFileIfMissing(path: Path, vararg attrs: FileAttribute<*>): Boolean
Create a file, if it does not already exist. |
|
static fun deleteRecursively(directory: Path): Unit
Delete a directory and all files contained within it. |