Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class LoadResource

extends Task
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.taskdefs.LoadFile
Imports
java.io.BufferedInputStream, .IOException, .InputStreamReader, java.nio.charset.Charset, java.util.List, .Vector, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.filters.util.ChainReaderHelper, .ChainReaderHelper.ChainReader, org.apache.tools.ant.types.FilterChain, .Resource, .ResourceCollection

Load a resource into a property
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private String
encoding

Encoding to use for filenames, defaults to the platform's default encoding.

private boolean
failOnError

what to do when it goes pear-shaped

private final List<FilterChain>
filterChains

Holds FilterChains

private String
property

name of property

private boolean
quiet

suppress error message if it goes pear-shaped, sets failOnError=false

private Resource
src

The resource to load.

Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addConfigured(ResourceCollection
the resource to load as a single element Resource collection.
a
)

Set the source resource.

public final void
addFilterChain(FilterChain
the filter to add
filter
)

Add the FilterChain element.

public final void
execute()

Overrides org.apache.tools.ant.Task.execute.

read in a source file to a property
public final void
setEncoding(final String
The new Encoding value
encoding
)

Encoding to use for input, defaults to the platform's default encoding.

public final void
setFailonerror(final boolean
The new Failonerror value
fail
)

If true, fail on load error.

public final void
setProperty(final String
The new Property value
property
)

Property name to save to.

public void
setQuiet(final boolean
The new Quiet value
quiet
)

If true, suppress the load error report and set the the failonerror value to false.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

encodingback to summary
private String encoding

Encoding to use for filenames, defaults to the platform's default encoding.

failOnErrorback to summary
private boolean failOnError

what to do when it goes pear-shaped

filterChainsback to summary
private final List<FilterChain> filterChains

Holds FilterChains

propertyback to summary
private String property

name of property

quietback to summary
private boolean quiet

suppress error message if it goes pear-shaped, sets failOnError=false

srcback to summary
private Resource src

The resource to load.

Constructor Detail

LoadResourceback to summary
public LoadResource()

Method Detail

addConfiguredback to summary
public void addConfigured(ResourceCollection a)

Set the source resource.

Parameters
a:ResourceCollection

the resource to load as a single element Resource collection.

addFilterChainback to summary
public final void addFilterChain(FilterChain filter)

Add the FilterChain element.

Parameters
filter:FilterChain

the filter to add

executeback to summary
public final void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

read in a source file to a property

Annotations
@Override
Exceptions
BuildException:
if something goes wrong with the build
setEncodingback to summary
public final void setEncoding(final String encoding)

Encoding to use for input, defaults to the platform's default encoding.

For a list of possible values see https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html .

Parameters
encoding:String

The new Encoding value

setFailonerrorback to summary
public final void setFailonerror(final boolean fail)

If true, fail on load error.

Parameters
fail:boolean

The new Failonerror value

setPropertyback to summary
public final void setProperty(final String property)

Property name to save to.

Parameters
property:String

The new Property value

setQuietback to summary
public void setQuiet(final boolean quiet)

If true, suppress the load error report and set the the failonerror value to false.

Parameters
quiet:boolean

The new Quiet value