1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 | <head>
|
---|
19 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
20 | <title>LoadResource Task</title>
|
---|
21 | </head>
|
---|
22 |
|
---|
23 | <body>
|
---|
24 |
|
---|
25 |
|
---|
26 | <h2><a name="loadresource">LoadResource</a></h2>
|
---|
27 |
|
---|
28 | <p><em>Since Ant 1.7</em></p>
|
---|
29 |
|
---|
30 | <h3>Description</h3>
|
---|
31 | <p>
|
---|
32 | Load a text resource into a single property. Unless an encoding is
|
---|
33 | specified, the encoding of the current locale is used. Resources to
|
---|
34 | load are specified as nested <a
|
---|
35 | href="../CoreTypes/resources.html">resource</a> elements or single
|
---|
36 | element resource collections.
|
---|
37 | </p>
|
---|
38 |
|
---|
39 | <h3>Parameters</h3>
|
---|
40 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
41 | <tr>
|
---|
42 | <td valign="top"><b>Attribute</b></td>
|
---|
43 | <td valign="top"><b>Description</b></td>
|
---|
44 | <td align="center" valign="top"><b>Required</b></td>
|
---|
45 | </tr>
|
---|
46 | <tr>
|
---|
47 | <td valign="top">property</td>
|
---|
48 | <td valign="top">property to save to</td>
|
---|
49 | <td valign="top" align="center">Yes</td>
|
---|
50 | </tr>
|
---|
51 | <tr>
|
---|
52 | <td valign="top">encoding</td>
|
---|
53 | <td valign="top">encoding to use when loading the resource</td>
|
---|
54 | <td align="center" valign="top">No</td>
|
---|
55 | </tr>
|
---|
56 | <tr>
|
---|
57 | <td valign="top">failonerror</td>
|
---|
58 | <td valign="top">Whether to halt the build on failure</td>
|
---|
59 | <td align="center" valign="top">No, default "true"</td>
|
---|
60 | </tr>
|
---|
61 | <tr>
|
---|
62 | <td valign="top">quiet</td>
|
---|
63 | <td valign="top">Do not display a diagnostic message (unless Ant has been
|
---|
64 | invoked with the <code>-verbose</code> or <code>-debug</code>
|
---|
65 | switches) or modify the exit status to reflect an error. Setting this to
|
---|
66 | "true" implies setting failonerror to "false".
|
---|
67 | </td>
|
---|
68 | <td align="center" valign="top">No, default "false"</td>
|
---|
69 | </tr>
|
---|
70 | </table>
|
---|
71 | <p>
|
---|
72 | The LoadResource task supports nested <a href="../CoreTypes/filterchain.html">
|
---|
73 | FilterChain</a>s.
|
---|
74 |
|
---|
75 | <h3>Examples</h3>
|
---|
76 | <pre>
|
---|
77 | <loadresource property="homepage">
|
---|
78 | <url url="http://ant.apache.org/index.html"/>
|
---|
79 | </loadresource>
|
---|
80 | </pre>
|
---|
81 | Load the entry point of Ant's homepage into property "homepage"; an
|
---|
82 | <tt><echo></tt> can print this.
|
---|
83 |
|
---|
84 | <p>For more examples see the <a href="loadfile.html">loadfile</a> task.</p>
|
---|
85 |
|
---|
86 |
|
---|
87 | </body>
|
---|
88 | </html>
|
---|
89 |
|
---|