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

public Class LoadProperties

extends Task
Class Inheritance
Imports
java.io.BufferedInputStream, .ByteArrayInputStream, .File, .IOException, .InputStreamReader, java.nio.charset.Charset, .StandardCharsets, java.util.List, .Properties, .Vector, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.filters.util.ChainReaderHelper, .ChainReaderHelper.ChainReader, org.apache.tools.ant.types.FilterChain, .Path, .Reference, .Resource, .ResourceCollection, org.apache.tools.ant.types.resources.FileResource, .JavaResource

Load a file's contents as Ant properties.
Since
Ant 1.5

Field Summary

Modifier and TypeField and Description
private String
encoding

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

private final List<FilterChain>
filterChains

Holds filterchains

private String
prefix

Prefix for loaded properties.

private boolean
private Resource
src

Source resource.

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized 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
)

Adds a FilterChain.

public Path

Returns:

The classpath to be configured
createClasspath
()

Add a classpath to use when looking up a resource.

public final void
execute()

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

load Ant properties from the source file or resource
public Path

Returns:

The classpath
getClasspath
()

get the classpath used by this LoadProperties.

private synchronized JavaResource
public void
setClasspath(Path
to add to any existing classpath
classpath
)

Set the classpath to use when looking up a resource.

public void
setClasspathRef(Reference
The reference value
r
)

Set the classpath to use when looking up a resource, given as reference to a <path> defined elsewhere

public final void
setEncoding(final String
The new Encoding value
encoding
)

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

public void
setPrefix(String
to set
prefix
)

Set the prefix to load these properties under.

public void
setPrefixValues(boolean
boolean
b
)

Whether to apply the prefix when expanding properties on the right hand side of a properties file as well.

public void
setResource(String
resource on classpath
resource
)

Set the resource name of a property file to load.

public final void
setSrcFile(final File
The new SrcFile value
srcFile
)

Set the file to load.

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

Field Detail

encodingback to summary
private String encoding

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

filterChainsback to summary
private final List<FilterChain> filterChains

Holds filterchains

prefixback to summary
private String prefix

Prefix for loaded properties.

prefixValuesback to summary
private boolean prefixValues
srcback to summary
private Resource src

Source resource.

Constructor Detail

LoadPropertiesback to summary
public LoadProperties()

Method Detail

addConfiguredback to summary
public synchronized void addConfigured(ResourceCollection a)

Set the source resource.

Parameters
a:ResourceCollection

the resource to load as a single element Resource collection.

Since
Ant 1.7
addFilterChainback to summary
public final void addFilterChain(FilterChain filter)

Adds a FilterChain.

Parameters
filter:FilterChain

the filter to add

createClasspathback to summary
public Path createClasspath()

Add a classpath to use when looking up a resource.

Returns:Path

The classpath to be configured

executeback to summary
public final void execute() throws BuildException

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

load Ant properties from the source file or resource

Annotations
@Override
Exceptions
BuildException:
if something goes wrong with the build
getClasspathback to summary
public Path getClasspath()

get the classpath used by this LoadProperties.

Returns:Path

The classpath

getRequiredJavaResourceback to summary
private synchronized JavaResource getRequiredJavaResource()
setClasspathback to summary
public void setClasspath(Path classpath)

Set the classpath to use when looking up a resource.

Parameters
classpath:Path

to add to any existing classpath

setClasspathRefback to summary
public void setClasspathRef(Reference r)

Set the classpath to use when looking up a resource, given as reference to a <path> defined elsewhere

Parameters
r:Reference

The reference value

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

setPrefixback to summary
public void setPrefix(String prefix)

Set the prefix to load these properties under.

Parameters
prefix:String

to set

setPrefixValuesback to summary
public void setPrefixValues(boolean b)

Whether to apply the prefix when expanding properties on the right hand side of a properties file as well.

Parameters
b:boolean

boolean

Since
Ant 1.8.2
setResourceback to summary
public void setResource(String resource)

Set the resource name of a property file to load.

Parameters
resource:String

resource on classpath

setSrcFileback to summary
public final void setSrcFile(final File srcFile)

Set the file to load.

Parameters
srcFile:File

The new SrcFile value