2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2005-11-25 08:47:50 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
|
|
|
<title>LoadResource Task</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<h2 id="loadresource">LoadResource</h2>
|
2005-11-29 04:40:12 +00:00
|
|
|
|
2010-11-11 17:04:16 +00:00
|
|
|
<p><em>Since Apache Ant 1.7</em></p>
|
2005-11-29 04:40:12 +00:00
|
|
|
|
2005-11-25 08:47:50 +00:00
|
|
|
<h3>Description</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Load a text resource into a single property. Unless an encoding is specified, the encoding of the
|
|
|
|
current locale is used. Resources to load are specified as
|
|
|
|
nested <a href="../Types/resources.html">resource</a> elements or single element resource
|
|
|
|
collections. If the resource content is empty (maybe after processing a <code>filterchain</code>)
|
|
|
|
the property is not set.</p>
|
2005-11-25 08:47:50 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Since properties are immutable, the task will not change the value of an existing property.</p>
|
2009-01-06 09:36:19 +00:00
|
|
|
|
2005-11-25 08:47:50 +00:00
|
|
|
<h3>Parameters</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2005-11-25 08:47:50 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
2005-11-25 08:47:50 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>property</td>
|
|
|
|
<td>property to save to</td>
|
|
|
|
<td>Yes</td>
|
2005-11-25 08:47:50 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>encoding</td>
|
|
|
|
<td>encoding to use when loading the resource</td>
|
|
|
|
<td>No</td>
|
2005-11-25 08:47:50 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>failonerror</td>
|
|
|
|
<td>Whether to halt the build on failure</td>
|
|
|
|
<td>No; default is <q>true</q></td>
|
2005-11-25 08:47:50 +00:00
|
|
|
</tr>
|
2006-11-13 21:11:42 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>quiet</td>
|
|
|
|
<td>Do not display a diagnostic message (unless Ant has been invoked with
|
2018-03-10 20:17:33 +01:00
|
|
|
the <kbd>-verbose</kbd> or <kbd>-debug</kbd> switches) or modify the exit status to
|
2018-02-28 07:58:59 +01:00
|
|
|
reflect an error. Setting this to <q>true</q> implies setting <var>failonerror</var>
|
|
|
|
to <q>false</q>.</td>
|
|
|
|
<td>No; default is <q>false</q></td>
|
2006-11-13 21:11:42 +00:00
|
|
|
</tr>
|
2005-11-25 08:47:50 +00:00
|
|
|
</table>
|
2018-03-08 07:43:53 +01:00
|
|
|
<p>The LoadResource task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p>
|
2005-11-25 08:47:50 +00:00
|
|
|
|
|
|
|
<h3>Examples</h3>
|
2018-05-15 09:51:58 +02:00
|
|
|
|
|
|
|
<p>Load the entry point of Ant's homepage into property <code>homepage</code>;
|
|
|
|
an <code><echo></code> can print this.</p>
|
2005-11-25 08:47:50 +00:00
|
|
|
<pre>
|
|
|
|
<loadresource property="homepage">
|
2018-02-28 07:58:59 +01:00
|
|
|
<url url="http://ant.apache.org/index.html"/>
|
|
|
|
</loadresource></pre>
|
2005-11-25 08:47:50 +00:00
|
|
|
|
|
|
|
<p>For more examples see the <a href="loadfile.html">loadfile</a> task.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|