read

open suspend override fun read(path: Path): String?(source)

Reads file content with UTF-8 decoding. This operation ensures proper handling of:

  • Missing files (returns null)

  • Text encoding (UTF-8)

  • Binary files (may throw if not valid UTF-8)

Return

File content as string, or null if file doesn't exist

Parameters

path

File to read

Throws

if content is not valid UTF-8