Functions

Link copied to clipboard
abstract fun copy(source: Path, target: Path)

Copies all the bytes from the file at source to the file at target. This does not copy file metadata like last modified time, permissions, or extended attributes.

Link copied to clipboard
abstract fun createDirectories(dir: Path, mustCreate: Boolean = false)

Creates a directory at the path identified by dir, and any enclosing parent path directories, recursively.

Link copied to clipboard
abstract fun createDirectory(dir: Path)

Creates a directory at the path identified by dir.

Link copied to clipboard
abstract fun delete(fileOrDirectory: Path, mustExist: Boolean = false)
Link copied to clipboard
abstract fun deleteRecursively(fileOrDirectory: Path, mustExist: Boolean = false)

Recursively deletes all children of fileOrDirectory if it is a directory, then deletes fileOrDirectory itself.

Link copied to clipboard
abstract fun exists(path: Path): Boolean

Returns true if path identifies an object on this file system.

Link copied to clipboard
abstract fun findFilesToProcess(from: Path, recursive: Boolean, maxDepth: Int?, exclude: Regex?): List<Path>

Finds SVG or XML files to process within a given directory.

Link copied to clipboard
abstract fun isDirectory(path: Path): Boolean
Link copied to clipboard
abstract fun readBytes(file: Path): ByteArray

Reads the entire content of a file into a byte array.

Link copied to clipboard
abstract fun readContent(file: Path): String

Read the content of file

Link copied to clipboard
abstract fun write(file: Path, mustCreate: Boolean = false, writerAction: BufferedSink.() -> Unit)

Creates a sink to write file, executes writerAction to write it, and then closes the sink. This is a compact way to write a file.