Package org.apache.tools.ant.taskdefs
Class LoadProperties
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.LoadProperties
- All Implemented Interfaces:
- Cloneable
Load a file's contents as Ant properties.
- Since:
- Ant 1.5
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidSet the source resource.final voidaddFilterChain(FilterChain filter) Adds a FilterChain.Add a classpath to use when looking up a resource.final voidexecute()load Ant properties from the source file or resourceget the classpath used by thisLoadProperties.voidsetClasspath(Path classpath) Set the classpath to use when looking up a resource.voidSet the classpath to use when looking up a resource, given as reference to a <path> defined elsewherefinal voidsetEncoding(String encoding) Encoding to use for input, defaults to the platform's default encoding.voidSet the prefix to load these properties under.voidsetPrefixValues(boolean b) Whether to apply the prefix when expanding properties on the right hand side of a properties file as well.voidsetResource(String resource) Set the resource name of a property file to load.final voidsetSrcFile(File srcFile) Set the file to load.Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Constructor Details- 
LoadPropertiespublic LoadProperties()
 
- 
- 
Method Details- 
setSrcFileSet the file to load.- Parameters:
- srcFile- The new SrcFile value
 
- 
setResourceSet the resource name of a property file to load.- Parameters:
- resource- resource on classpath
 
- 
setEncodingEncoding 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- The new Encoding value
 
- 
setClasspathSet the classpath to use when looking up a resource.- Parameters:
- classpath- to add to any existing classpath
 
- 
createClasspathAdd a classpath to use when looking up a resource.- Returns:
- The classpath to be configured
 
- 
setClasspathRefSet the classpath to use when looking up a resource, given as reference to a <path> defined elsewhere- Parameters:
- r- The reference value
 
- 
getClasspathget the classpath used by thisLoadProperties.- Returns:
- The classpath
 
- 
setPrefixSet the prefix to load these properties under.- Parameters:
- prefix- to set
 
- 
setPrefixValuespublic 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
- Since:
- Ant 1.8.2
 
- 
executeload Ant properties from the source file or resource- Overrides:
- executein class- Task
- Throws:
- BuildException- if something goes wrong with the build
 
- 
addFilterChainAdds a FilterChain.- Parameters:
- filter- the filter to add
 
- 
addConfiguredSet the source resource.- Parameters:
- a- the resource to load as a single element Resource collection.
- Since:
- Ant 1.7
 
 
-