|
EchoProperties (Apache Ant API)
org.apache.tools.ant.taskdefs.optional
|
Field Summary |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
EchoProperties()
|
Method Summary | |
void |
execute()
Run the task. |
protected void |
jdk10SaveProperties(java.util.Properties props,
java.io.OutputStream os,
java.lang.String header)
Save the properties to the output stream using the JDK 1.0 compatible method. |
protected void |
jdkSaveProperties(java.util.Properties props,
java.io.OutputStream os,
java.lang.String header)
JDK 1.2 allows for the safer method Properties.store( OutputStream, String ), which throws an IOException on an output error. |
protected void |
saveProperties(java.util.Hashtable allProps,
java.io.OutputStream os)
Send the key/value pairs in the hashtable to the given output stream. |
void |
setDestfile(java.io.File destfile)
Set a file to store the property output. |
void |
setFailOnError(boolean failonerror)
If true, the task will fail if an error occurs writing the properties file, otherwise errors are just logged. |
void |
setPrefix(java.lang.String prefix)
If the prefix is set, then only properties which start with this prefix string will be recorded. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EchoProperties()
Method Detail |
public void setDestfile(java.io.File destfile)
destfile
- file to store the property outputpublic void setFailOnError(boolean failonerror)
failonerror
- true if IO exceptions are reported as build
exceptions, or false if IO exceptions are ignored.public void setPrefix(java.lang.String prefix)
For example, if the property is set as:
<echoproperties prefix="ant." />then the property "ant.home" will be recorded, but "ant-example" will not.
prefix
- The new prefix valuepublic void execute() throws BuildException
BuildException
- trouble, probably file IOprotected void saveProperties(java.util.Hashtable allProps, java.io.OutputStream os) throws java.io.IOException, BuildException
allProps
- propfile to saveos
- output stream
java.io.IOException
- trouble
BuildException
protected void jdkSaveProperties(java.util.Properties props, java.io.OutputStream os, java.lang.String header) throws java.io.IOException
props
- the properties to recordos
- record the properties to this output streamheader
- prepend this header to the property output
java.io.IOException
- on an I/O error during a write. Only thrown
for JDK 1.2+.protected void jdk10SaveProperties(java.util.Properties props, java.io.OutputStream os, java.lang.String header)
props
- the properties to recordos
- record the properties to this output streamheader
- prepend this header to the property output
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |