2002-03-06 03:25:51 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2002-03-06 03:25:51 +00:00
|
|
|
<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
|
2004-11-19 09:07:12 +00:00
|
|
|
to <code><property file|resource="..."/></code> except that it
|
|
|
|
supports nested <code><filterchain></code> elements.
|
2005-04-19 19:21:10 +00:00
|
|
|
Also if the file is missing, the build is halted with an error, rather
|
|
|
|
than a warning being printed.
|
2002-03-06 03:25:51 +00:00
|
|
|
</p>
|
|
|
|
|
2003-03-19 08:54:08 +00:00
|
|
|
<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>
|
|
|
|
|
2002-03-06 03:25:51 +00:00
|
|
|
<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>
|
2004-04-20 19:29:56 +00:00
|
|
|
<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>
|
2002-03-06 03:25:51 +00:00
|
|
|
</tr>
|
2002-07-19 17:48:36 +00:00
|
|
|
<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>
|
2004-04-20 19:29:56 +00:00
|
|
|
<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>
|
2004-11-19 09:07:12 +00:00
|
|
|
to a <code><path></code> defined elsewhere..</td>
|
2004-04-20 19:29:56 +00:00
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2002-03-06 03:25:51 +00:00
|
|
|
</table>
|
|
|
|
<p>
|
|
|
|
The LoadProperties task supports nested <a href="../CoreTypes/filterchain.html">
|
2004-04-20 19:29:56 +00:00
|
|
|
FilterChain</a>s, as well as a nested <code><classpath></code>
|
|
|
|
element for use with the <i>resource</i> attribute.
|
2002-03-06 03:25:51 +00:00
|
|
|
|
|
|
|
<h3>Examples</h3>
|
2002-09-04 11:05:19 +00:00
|
|
|
<pre> <loadproperties srcFile="file.properties"/>
|
2002-03-06 03:25:51 +00:00
|
|
|
</pre>
|
|
|
|
Load contents of file.properties as Ant properties.
|
|
|
|
|
|
|
|
<pre> <loadproperties srcFile="file.properties">
|
|
|
|
<filterchain>
|
|
|
|
<<a href="../CoreTypes/filterchain.html#linecontains">linecontains</a>>
|
2003-03-19 08:54:08 +00:00
|
|
|
<contains value="import."/>
|
2002-09-23 11:06:53 +00:00
|
|
|
</linecontains>
|
|
|
|
</filterchain>
|
2002-03-06 03:25:51 +00:00
|
|
|
</loadproperties>
|
|
|
|
</pre>
|
|
|
|
Read the lines that contain the string "import."
|
|
|
|
from the file "file.properties" and load them as
|
|
|
|
Ant properties.
|
|
|
|
<hr>
|
|
|
|
|
2005-03-07 18:09:10 +00:00
|
|
|
<p align="center">Copyright © 2002-2005 The Apache Software Foundation. All rights
|
2002-03-06 03:25:51 +00:00
|
|
|
Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|