2001-12-25 06:14:40 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>LoadFile Task</title>
|
2001-12-25 06:14:40 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2002-02-01 07:23:56 +00:00
|
|
|
|
2001-12-25 06:14:40 +00:00
|
|
|
<h2><a name="loadfile">LoadFile</a></h2>
|
|
|
|
<h3>Description</h3>
|
|
|
|
<p>
|
|
|
|
Load a text file into a single property. Unless an encoding is specified,
|
|
|
|
the encoding of the current locale is used. There is no explicit limit
|
|
|
|
upon the size of the file which can be loaded, but loading very large
|
2002-02-01 07:23:56 +00:00
|
|
|
files is not something anyone has yet explored. Because the file is
|
|
|
|
converted to text
|
|
|
|
|
2001-12-25 06:14:40 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
2002-02-01 07:23:56 +00:00
|
|
|
<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-02-01 07:23:56 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">evaluateProperties</td>
|
|
|
|
<td valign="top">flag to enable property evalation in the file</td>
|
|
|
|
<td align="center" valign="top">No, default "false"</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">makeOneLine</td>
|
|
|
|
<td valign="top">flag to strip out newlines (but not spaces or
|
|
|
|
tabs) from the file</td>
|
|
|
|
<td align="center" valign="top">No, default "false"</td>
|
|
|
|
</tr>
|
2001-12-25 06:14:40 +00:00
|
|
|
</table>
|
2002-02-01 07:23:56 +00:00
|
|
|
<p>
|
|
|
|
The <tt>makeOneLine</tt> parameter enables you to use a file as an
|
|
|
|
input to task parameters which expect single line input. It flattens
|
|
|
|
the file by removing all carriage return and line feed characters,
|
|
|
|
so that the file
|
|
|
|
<pre>a
|
|
|
|
b
|
|
|
|
c
|
|
|
|
</pre>would become "abc": you need spaces or
|
|
|
|
commas at the end/start of line to stop alphanumeric characters
|
|
|
|
being merged together.
|
2001-12-25 06:14:40 +00:00
|
|
|
|
|
|
|
<h3>Examples</h3>
|
2002-02-01 07:23:56 +00:00
|
|
|
<pre> <loadfile property="message"
|
|
|
|
srcFile="message.txt" / >
|
2001-12-25 06:14:40 +00:00
|
|
|
</pre>
|
2002-02-01 07:23:56 +00:00
|
|
|
Load file message.txt into property "message"; an <tt><echo></tt>
|
|
|
|
can print this.
|
2001-12-25 06:14:40 +00:00
|
|
|
|
|
|
|
<pre> <loadfile property="encoded-file"
|
|
|
|
srcFile="loadfile.xml"
|
|
|
|
encoding="ISO-8859-1" / >
|
|
|
|
</pre>
|
|
|
|
Load a file using the latin-1 encoding
|
|
|
|
|
2002-02-01 07:23:56 +00:00
|
|
|
<pre> <loadfile
|
|
|
|
property="optional.value"
|
|
|
|
srcFile="optional.txt"
|
2001-12-25 06:14:40 +00:00
|
|
|
failonerror="false" />
|
|
|
|
</pre>
|
2002-02-01 07:23:56 +00:00
|
|
|
Load a file, don't fail if it is missing (a message is printed, though)
|
|
|
|
|
|
|
|
<pre> <loadfile
|
|
|
|
property="mail.recipients"
|
|
|
|
srcFile="recipientlist.txt"
|
|
|
|
makeOneLine="true" />
|
|
|
|
</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
|
|
|
|
property="system.configuration.xml"
|
|
|
|
srcFile="configuration.xml"
|
|
|
|
evaluateProperties="true" />
|
|
|
|
</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-02-01 07:23:56 +00:00
|
|
|
<p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights
|
2001-12-25 06:14:40 +00:00
|
|
|
Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|