source

abstract fun source(path: Path): RawSource(source)

Returns RawSource to read from a file the path points to.

How a source will read the data is implementation-specific and failures caused by the missing file or, for example, lack of permissions may not be reported immediately, but postponed until the source will try to fetch data.

If path points to a directory, this method will fail with IOException.

Parameters

path

the path to read from.

Throws

when the file does not exist.

when it's not possible to open the file for reading.