@Incubating public interface TextResource extends Buildable
TextResourceFactory
(e.g. project.resources.text.fromFile(myFile)
).Modifier and Type | Method and Description |
---|---|
java.io.File |
asFile()
Same as
asFile(Charset.defaultCharset().name()) . |
java.io.File |
asFile(java.lang.String charset)
Returns a file containing the resource's text and using the given character encoding.
|
java.io.Reader |
asReader()
Returns an unbuffered
Reader that allows the resource's text to be read. |
java.lang.String |
asString()
Returns a string containing the resource's text
|
TaskDependency |
getBuildDependencies()
Returns a dependency which contains the tasks which build this artifact.
|
FileCollection |
getInputFiles()
Returns the input files registered when this resource is used as task input.
|
java.lang.Object |
getInputProperties()
Returns the input properties registered when this resource is used as task input.
|
java.lang.String asString()
java.io.Reader asReader()
Reader
that allows the resource's text to be read. The caller is responsible for closing the reader.java.io.File asFile(java.lang.String charset)
charset
- a character encoding (e.g. "utf-8"
)java.io.File asFile()
asFile(Charset.defaultCharset().name())
.@Input @Optional java.lang.Object getInputProperties()
@InputFiles @Optional FileCollection getInputFiles()
@Internal TaskDependency getBuildDependencies()
Buildable
Buildable
implementations
must ensure that the returned dependency object is live, so that it tracks changes to the dependencies of this
buildable.getBuildDependencies
in interface Buildable