class File: Any

Representation of a file or directory.

Fields

Name Description
val name: String

Name of the file or directory with potential file extension.

val nameWithoutExtension: String

Name of file or directory without extension.

val extension: String

Extension of the file, in case it has one.

val hashSha256: /** * SHA256 hash of the file or directory. */

SHA256 hash of the file or directory.

val creationTime: /** * Time of file or directory creation. */

Time of file or directory creation.

val lastAccessTime: /** * Time of file or directory last access. */

Time of file or directory last access.

val lastModified: /** * Time of file or directory last modification. */

Time of file or directory last modification.

val path: Path

path to the file or directory

Constructors

<init>

constructor(path: Path)

Representation of a file or directory.

Parameters

Name Description
path: Path

path to the file or directory

Methods

readText

fun readText(): String

Reads and returns the text of the file.

ReturnValue

Name Description
String

text of the file