# fromFile

abstract fun fromFile(file: Any, charset: String): TextResource

Creates a text resource backed by the given file.

#### Return

a text resource backed by the given file

#### Parameters

file

a text file evaluated as per files

charset

the file's character encoding (e.g. `"utf-8"`)

abstract fun fromFile(file: Any): TextResource

Same as `fromFile(file, Charset.defaultCharset())`.

#### See also

fromFile(Object, String)