readText

Reads the content of a file based on its source type. If the file source is a local path, the file content is read and returned as a string. If the file source is a URL, an error is thrown.

Return

The text content of the file if the source is a local path.

Throws

if the source is a URL, as reading directly from a URL is not supported.