TextResource

A read-only body of text backed by a string, file, archive entry, or other source. To create a text resource, use one of the factory methods in TextResourceFactory (e.g. project.resources.text.fromFile(myFile)).

Since

2.2

Functions

Link copied to clipboard
abstract fun asFile(): File
Same as asFile(Charset.defaultCharset().name()).
abstract fun asFile(charset: String): File
Returns a file containing the resource's text and using the given character encoding.
Link copied to clipboard
abstract fun asReader(): Reader
Returns an unbuffered Reader that allows the resource's text to be read.
Link copied to clipboard
abstract fun asString(): String
Returns a string containing the resource's text
Link copied to clipboard
Link copied to clipboard
Returns the input files registered when this resource is used as task input.
Link copied to clipboard
@Nullable
abstract fun getInputProperties(): Any
Returns the input properties registered when this resource is used as task input.