For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

asFile

abstract fun asFile(charset: String): File(source)

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

Since

2.2

Parameters

charset

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


abstract fun asFile(): File(source)

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

Since

2.2