2002-12-20 01:38:31 +00:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2001-12-25 06:14:40 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2002-12-20 01:38:31 +00:00
|
|
|
<title>LoadFile Task</title>
|
2001-12-25 06:14:40 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h2><a name="loadfile">LoadFile</a></h2>
|
|
|
|
<h3>Description</h3>
|
2002-12-20 01:38:31 +00:00
|
|
|
<p> Load a text file into a single property. Unless an encoding is specified,
|
|
|
|
the encoding of the current locale is used. </p>
|
2001-12-25 06:14:40 +00:00
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
2002-12-20 01:38:31 +00:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2001-12-25 06:14:40 +00:00
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
2002-02-01 07:23:56 +00:00
|
|
|
<tr>
|
2001-12-25 06:14:40 +00:00
|
|
|
<td valign="top">srcFile</td>
|
|
|
|
<td valign="top">source file</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
2002-02-01 07:23:56 +00:00
|
|
|
<tr>
|
2001-12-25 06:14:40 +00:00
|
|
|
<td valign="top">property</td>
|
|
|
|
<td valign="top">property to save to</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
2002-02-01 07:23:56 +00:00
|
|
|
<tr>
|
2001-12-25 06:14:40 +00:00
|
|
|
<td valign="top">encoding</td>
|
|
|
|
<td valign="top">encoding to use when loading the file</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2002-02-01 07:23:56 +00:00
|
|
|
<tr>
|
2001-12-25 06:14:40 +00:00
|
|
|
<td valign="top">failonerror</td>
|
|
|
|
<td valign="top">Whether to halt the build on failure</td>
|
|
|
|
<td align="center" valign="top">No, default "true"</td>
|
|
|
|
</tr>
|
2002-12-20 01:38:31 +00:00
|
|
|
</tbody>
|
2001-12-25 06:14:40 +00:00
|
|
|
</table>
|
2002-12-20 01:38:31 +00:00
|
|
|
<p>The LoadFile task supports nested <a
|
|
|
|
href="../CoreTypes/filterchain.html">FilterChain</a>s. </p>
|
2001-12-25 06:14:40 +00:00
|
|
|
<h3>Examples</h3>
|
2002-12-20 01:38:31 +00:00
|
|
|
<pre> <loadfile property="message"<br> srcFile="message.txt"/><br></pre>
|
|
|
|
Load file message.txt into property "message"; an <tt><echo></tt>can
|
|
|
|
print this.
|
|
|
|
<pre> <loadfile property="encoded-file"<br> srcFile="loadfile.xml"<br> encoding="ISO-8859-1"/><br></pre>
|
|
|
|
Load a file using the latin-1 encoding
|
|
|
|
<pre> <loadfile<br> property="optional.value"<br> srcFile="optional.txt"<br> failonerror="false"/><br></pre>
|
|
|
|
Load a file, don't fail if it is missing (a message is printed, though)
|
|
|
|
<pre> <loadfile<br> property="mail.recipients"<br> srcFile="recipientlist.txt"><br> <filterchain><br> <<a
|
|
|
|
href="../CoreTypes/filterchain.html#striplinebreaks">striplinebreaks</a>/><br> </filterchain><br> </loadfile><br></pre>
|
|
|
|
Load a property which can be used as a parameter for another task (in this
|
|
|
|
case mail), merging lines to ensure this happens.
|
|
|
|
<pre> <loadfile<br> property="system.configuration.xml"<br> srcFile="configuration.xml"><br> <filterchain><br> <<a
|
|
|
|
href="../CoreTypes/filterchain.html#expandproperties">expandproperties</a>/><br> </filterchain><br> </loadfile><br></pre>
|
|
|
|
Load an XML file into a property, expanding all properties declared in the
|
|
|
|
file in the process.
|
2001-12-25 06:14:40 +00:00
|
|
|
<hr>
|
2002-12-20 01:38:31 +00:00
|
|
|
<p align="center">Copyright © 2001-2002 Apache Software Foundation.
|
|
|
|
All rights Reserved.</p>
|
|
|
|
<br>
|
2001-12-25 06:14:40 +00:00
|
|
|
</body>
|
|
|
|
</html>
|