source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.6.2/manual/CoreTasks/loadproperties.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 2.6 KB
Line 
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>
13Load a file's contents as Ant properties. This is equivalent
14to &lt;property file|resource=&quot;...&quot;/&gt; except that it
15supports nested &lt;filterchain&gt; elements.
16</p>
17
18<p>If you want to simulate <a href="property.html">property</a>'s
19prefix attribute, please use <a
20href="../CoreTypes/filterchain.html#prefixlines">prefixlines</a>
21filter.</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 &lt;path&gt; defined elsewhere..</td>
54 <td align="center" valign="top">No</td>
55 </tr>
56</table>
57<p>
58The LoadProperties task supports nested <a href="../CoreTypes/filterchain.html">
59FilterChain</a>s, as well as a nested <code>&lt;classpath&gt;</code>
60element for use with the <i>resource</i> attribute.
61
62<h3>Examples</h3>
63<pre> &lt;loadproperties srcFile="file.properties"/&gt;
64</pre>
65Load contents of file.properties as Ant properties.
66
67<pre> &lt;loadproperties srcFile="file.properties"&gt;
68 &lt;filterchain&gt;
69 &lt;<a href="../CoreTypes/filterchain.html#linecontains">linecontains</a>&gt;
70 &lt;contains value=&quot;import.&quot;/&gt;
71 &lt;/linecontains&gt;
72 &lt;/filterchain&gt;
73 &lt;/loadproperties&gt;
74</pre>
75Read the lines that contain the string &quot;import.&quot;
76from the file &quot;file.properties&quot; and load them as
77Ant properties.
78<hr>
79
80<p align="center">Copyright &copy; 2002-2004 The Apache Software Foundation. All rights
81Reserved.</p>
82
83</body>
84</html>
85
Note: See TracBrowser for help on using the repository browser.