forked from Uriziel47/ant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadproperties.html
140 lines (121 loc) · 4.59 KB
/
loadproperties.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!--
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.
-->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>LoadProperties Task</title>
</head>
<body>
<h2><a name="loadproperties">LoadProperties</a></h2>
<h3>Description</h3>
<p>
Load a file's contents as Apache Ant properties. This is equivalent
to <code><property file|resource="..."/></code> except that it
supports nested <code><filterchain></code> elements.
Also if the file is missing, the build is halted with an error, rather
than a warning being printed.
</p>
<p><strong>Note:</strong> the default value of this
task's <code>prefixValues</code> attribute is different from the
default value of the same attribute in
the <a href="property.html"><code><property></code></a>
task.</p>
<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>
<td valign="top" rowspan="2" align="center">One of these or a
nested resource</td>
</tr>
<tr>
<td valign="top">resource</td>
<td valign="top">the resource name of the property file</td>
</tr>
<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>
<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>
to a <code><path></code> defined elsewhere..</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">Prefix to apply to loaded properties;
a "." is appended to the prefix if not specified. <em>Since Ant 1.8.1</em></td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">prefixValues</td>
<td valign="top">Whether to apply the prefix when expanding the
right hand side of the properties.
<em>Since Ant 1.8.2</em></td>
<td align="center" valign="top">No (default=<tt>true</tt>)</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>any <a href="../Types/resources.html">resource</a> or single element
resource collection</h4>
<p>The specified resource will be used as src. <em>Since Ant 1.7</em></p>
<h4><a href="../Types/filterchain.html">FilterChain</a></h4>
<h4>classpath</h4>
<p>for use with the <i>resource</i> attribute.</p>
<h3>Examples</h3>
<pre> <loadproperties srcFile="file.properties"/>
</pre>
or
<pre>
<loadproperties>
<file file="file.properties"/>
</loadproperties>
</pre>
Load contents of file.properties as Ant properties.
<pre> <loadproperties srcFile="file.properties">
<filterchain>
<<a href="../Types/filterchain.html#linecontains">linecontains</a>>
<contains value="import."/>
</linecontains>
</filterchain>
</loadproperties>
</pre>
Read the lines that contain the string "import."
from the file "file.properties" and load them as
Ant properties.
<pre>
<loadproperties>
<<a href="../Types/resources.html#gzipresource">gzipresource</a>>
<<a href="../Types/resources.html#url">url</a> url="http://example.org/url.properties.gz"/>
</gzipresource>
</loadproperties>
</pre>
Load contents of http://example.org/url.properties.gz, uncompress it
on the fly and load the contents as Ant properties.
</body>
</html>