<html> <head> <title>LoadProperties Task</title> </head> <body> <h2><a name="loadproperties">LoadProperties</a></h2> <h3>Description</h3> <p> Load a file's contents as Ant properties. This is equivalent to <property file|resource="..."/> except that it supports nested <filterchain> elements. </p> <p>If you want to simulate <a href="property.html">property</a>'s prefix attribute, please use <a href="../CoreTypes/filterchain.html#prefixlines">prefixlines</a> filter.</p> <h3>Parameters</h3> <table border="1" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><b>Attribute</b></td> <td valign="top"><b>Description</b></td> <td align="center" valign="top"><b>Required</b></td> </tr> <tr> <td valign="top">srcFile</td> <td valign="top">source file</td> <td valign="top" rowspan="2" align="center">One of these</td> </tr> <tr> <td valign="top">resource</td> <td valign="top">the resource name of the property file</td> </tr> <tr> <td valign="top">encoding</td> <td valign="top">encoding to use when loading the file</td> <td align="center" valign="top">No</td> </tr> <tr> <td valign="top">classpath</td> <td valign="top">the classpath to use when looking up a resource.</td> <td align="center" valign="top">No</td> </tr> <tr> <td valign="top">classpathref</td> <td valign="top">the classpath to use when looking up a resource, given as <a href="../using.html#references">reference</a> to a <path> defined elsewhere..</td> <td align="center" valign="top">No</td> </tr> </table> <p> The LoadProperties task supports nested <a href="../CoreTypes/filterchain.html"> FilterChain</a>s, as well as a nested <code><classpath></code> element for use with the <i>resource</i> attribute. <h3>Examples</h3> <pre> <loadproperties srcFile="file.properties"/> </pre> Load contents of file.properties as Ant properties. <pre> <loadproperties srcFile="file.properties"> <filterchain> <<a href="../CoreTypes/filterchain.html#linecontains">linecontains</a>> <contains value="import."/> </linecontains> </filterchain> </loadproperties> </pre> Read the lines that contain the string "import." from the file "file.properties" and load them as Ant properties. <hr> <p align="center">Copyright © 2002-2004 The Apache Software Foundation. All rights Reserved.</p> </body> </html>