# asFile

abstract fun asFile(charset: String): File

Returns a file containing the resource's text and using the given character encoding. If this resource is backed by a file with a matching encoding, that file may be returned. Otherwise, a temporary file will be created and returned.

#### Return

a file containing the resource's text and using the given character encoding

#### Parameters

charset

a character encoding (e.g. `"utf-8"`)

abstract fun asFile(): File

Same as `asFile(Charset.defaultCharset().name())`.