FileHandler

interface FileHandler

A class through which all file I/O and operations are directed.

Since

8.30

Functions

Link copied to clipboard
abstract fun delete(path: String)

Deletes the file at the given path.

Link copied to clipboard
abstract fun list(dir: String): Array<String>

Returns the relative names of the files and directories in the given directory.

Link copied to clipboard
abstract fun mkdirs(dir: String)

Creates the given directory if it does not already exist.

Link copied to clipboard
abstract fun mkfile(path: String)

Creates a file at the given path, creating any intermediate directories as necessary.

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

Instantiates a File object for the given path.

abstract fun newFile(parent: File, childPath: String): File
abstract fun newFile(parentPath: String, childPath: String): File

Instantiates a File object for the given child path in the given parent directory.

Link copied to clipboard
abstract fun openIn(path: String): InputStream

Opens the file at the given path for reading.

Link copied to clipboard
abstract fun openOut(path: String): OutputStream

Opens the file at the given path for writing.

Link copied to clipboard
abstract fun readStr(path: String): String

Reads the file at the given path into a UTF-8-encoded string.

Link copied to clipboard
abstract fun writeStr(contents: String, path: String)

Writes the given UTF-8-encoded string into a file at the given path.