[14982] | 1 | <html>
|
---|
| 2 | <head>
|
---|
| 3 | <title>LoadProperties Task</title>
|
---|
| 4 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
| 5 | </head>
|
---|
| 6 |
|
---|
| 7 | <body>
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | <h2><a name="loadproperties">LoadProperties</a></h2>
|
---|
| 11 | <h3>Description</h3>
|
---|
| 12 | <p>
|
---|
| 13 | Load a file's contents as Ant properties. This is equivalent
|
---|
| 14 | to <property file|resource="..."/> except that it
|
---|
| 15 | supports nested <filterchain> elements.
|
---|
| 16 | </p>
|
---|
| 17 |
|
---|
| 18 | <p>If you want to simulate <a href="property.html">property</a>'s
|
---|
| 19 | prefix attribute, please use <a
|
---|
| 20 | href="../CoreTypes/filterchain.html#prefixlines">prefixlines</a>
|
---|
| 21 | filter.</p>
|
---|
| 22 |
|
---|
| 23 | <h3>Parameters</h3>
|
---|
| 24 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
| 25 | <tr>
|
---|
| 26 | <td valign="top"><b>Attribute</b></td>
|
---|
| 27 | <td valign="top"><b>Description</b></td>
|
---|
| 28 | <td align="center" valign="top"><b>Required</b></td>
|
---|
| 29 | </tr>
|
---|
| 30 | <tr>
|
---|
| 31 | <td valign="top">srcFile</td>
|
---|
| 32 | <td valign="top">source file</td>
|
---|
| 33 | <td valign="top" rowspan="2" align="center">One of these</td>
|
---|
| 34 | </tr>
|
---|
| 35 | <tr>
|
---|
| 36 | <td valign="top">resource</td>
|
---|
| 37 | <td valign="top">the resource name of the property file</td>
|
---|
| 38 | </tr>
|
---|
| 39 | <tr>
|
---|
| 40 | <td valign="top">encoding</td>
|
---|
| 41 | <td valign="top">encoding to use when loading the file</td>
|
---|
| 42 | <td align="center" valign="top">No</td>
|
---|
| 43 | </tr>
|
---|
| 44 | <tr>
|
---|
| 45 | <td valign="top">classpath</td>
|
---|
| 46 | <td valign="top">the classpath to use when looking up a resource.</td>
|
---|
| 47 | <td align="center" valign="top">No</td>
|
---|
| 48 | </tr>
|
---|
| 49 | <tr>
|
---|
| 50 | <td valign="top">classpathref</td>
|
---|
| 51 | <td valign="top">the classpath to use when looking up a resource,
|
---|
| 52 | given as <a href="../using.html#references">reference</a>
|
---|
| 53 | to a <path> defined elsewhere..</td>
|
---|
| 54 | <td align="center" valign="top">No</td>
|
---|
| 55 | </tr>
|
---|
| 56 | </table>
|
---|
| 57 | <p>
|
---|
| 58 | The LoadProperties task supports nested <a href="../CoreTypes/filterchain.html">
|
---|
| 59 | FilterChain</a>s, as well as a nested <code><classpath></code>
|
---|
| 60 | element for use with the <i>resource</i> attribute.
|
---|
| 61 |
|
---|
| 62 | <h3>Examples</h3>
|
---|
| 63 | <pre> <loadproperties srcFile="file.properties"/>
|
---|
| 64 | </pre>
|
---|
| 65 | Load contents of file.properties as Ant properties.
|
---|
| 66 |
|
---|
| 67 | <pre> <loadproperties srcFile="file.properties">
|
---|
| 68 | <filterchain>
|
---|
| 69 | <<a href="../CoreTypes/filterchain.html#linecontains">linecontains</a>>
|
---|
| 70 | <contains value="import."/>
|
---|
| 71 | </linecontains>
|
---|
| 72 | </filterchain>
|
---|
| 73 | </loadproperties>
|
---|
| 74 | </pre>
|
---|
| 75 | Read the lines that contain the string "import."
|
---|
| 76 | from the file "file.properties" and load them as
|
---|
| 77 | Ant properties.
|
---|
| 78 | <hr>
|
---|
| 79 |
|
---|
| 80 | <p align="center">Copyright © 2002-2004 The Apache Software Foundation. All rights
|
---|
| 81 | Reserved.</p>
|
---|
| 82 |
|
---|
| 83 | </body>
|
---|
| 84 | </html>
|
---|
| 85 |
|
---|