Buildable
public interface TextResource extends Buildable
TextResourceFactory
(e.g. project.resources.text.fromFile(myFile)
).Modifier and Type | Method | Description |
---|---|---|
File |
asFile() |
Same as
asFile(Charset.defaultCharset().name()) . |
File |
asFile(String charset) |
Returns a file containing the resource's text and using the given character encoding.
|
Reader |
asReader() |
Returns an unbuffered
Reader that allows the resource's text to be read. |
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.
|
Object |
getInputProperties() |
Returns the input properties registered when this resource is used as task input.
|
String asString()
Reader asReader()
Reader
that allows the resource's text to be read. The caller is responsible for closing the reader.File asFile(String charset)
charset
- a character encoding (e.g. "utf-8"
)File asFile()
asFile(Charset.defaultCharset().name())
.@Nullable @Optional @Input Object getInputProperties()
@Nullable @Optional @PathSensitive(NONE) @InputFiles 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