source: release-kits/lirk3/bin/ant-installer/web/manual/manual/CoreTasks/get.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 4.7 KB
Line 
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
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>Get Task</title>
23</head>
24
25<body>
26
27<h2><a name="get">Get</a></h2>
28<h3>Description</h3>
29<p>Gets a file from a URL. When the verbose option is &quot;on&quot;, this task
30displays a '.' for every 100 Kb retrieved. Any URL schema supported by
31the runtime is valid here, including http:, ftp: and jar:;
32https: is only valid if the appropriate support is added to the pre-1.4 Java
33runtimes.
34
35</p>
36The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
37only fetched if newer than the local copy. If there is no local copy, the download always takes
38place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
39if the JVM is Java1.2 or later.
40NB: This timestamp facility only works on downloads using the HTTP protocol.
41<p>
42A username and password can be specified, in which case basic 'slightly encoded
43plain text' authentication is used. This is only secure over an HTTPS link.
44</p>
45<p>
46<b>Proxies</b>. Since Ant1.7, Ant running on Java1.5 or later defaults to
47 <a href="../proxy.html">using
48 the proxy settings of the operating system</a>. There is also the
49 <a href="../OptionalTasks/setproxy.html">&lt;setproxy&gt;</a> task for
50 earlier Java versions. With proxies turned on, <code>&lt;get&gt;</code> requests against
51 localhost may not work as expected, if the request is relayed to the proxy.
52 The <code>-noproxy</code> option can be used to turn this feature off.
53</p>
54
55<h3>Parameters</h3>
56<table border="1" cellpadding="2" cellspacing="0">
57 <tr>
58 <td valign="top"><b>Attribute</b></td>
59 <td valign="top"><b>Description</b></td>
60 <td align="center" valign="top"><b>Required</b></td>
61 </tr>
62 <tr>
63 <td valign="top">src</td>
64 <td valign="top">the URL from which to retrieve a file.</td>
65 <td align="center" valign="top">Yes</td>
66 </tr>
67 <tr>
68 <td valign="top">dest</td>
69 <td valign="top">the file where to store the retrieved file.</td>
70 <td align="center" valign="top">Yes</td>
71 </tr>
72 <tr>
73 <td valign="top">verbose</td>
74 <td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
75 <td align="center" valign="top">No; default "false"</td>
76 </tr>
77 <tr>
78 <td valign="top">ignoreerrors</td>
79 <td valign="top">Log errors but don't treat as fatal.</td>
80 <td align="center" valign="top">No; default "false"</td>
81 </tr>
82 <tr>
83 <td valign="top">usetimestamp</td>
84 <td valign="top">conditionally download a file based on the timestamp of the
85 local copy. HTTP only</td>
86 <td align="center" valign="top">No; default "false"</td>
87 </tr>
88 <tr>
89 <td valign="top">username</td>
90 <td valign="top">username for 'BASIC' http authentication</td>
91 <td align="center" valign="top">if password is set</td>
92 </tr>
93 <tr>
94 <td valign="top">password</td>
95 <td valign="top">password: required </td>
96 <td align="center" valign="top">if username is set</td>
97 </tr>
98
99</table>
100<h3>Examples</h3>
101<pre> &lt;get src=&quot;http://ant.apache.org/&quot; dest=&quot;help/index.html&quot;/&gt;</pre>
102<p>Gets the index page of http://ant.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
103
104<pre> &lt;get src=&quot;http://www.apache.org/dist/ant/KEYS&quot;
105 dest=&quot;KEYS&quot;
106 verbose=&quot;true&quot;
107 usetimestamp=&quot;true&quot;/&gt;</pre>
108<p>
109Gets the PGP keys of Ant's (current and past) release managers, if the local copy
110is missing or out of date. Uses the verbose option
111for progress information.
112</p>
113
114<pre> &lt;get src=&quot;https://insecure-bank.org/statement/user=1214&quot;
115 dest=&quot;statement.html&quot;
116 username="1214";
117 password="secret"/&gt;</pre>
118<p>
119Fetches some file from a server with access control. Because https is being used the
120fact that basic auth sends passwords in plaintext is moot.
121
122
123</body>
124</html>
125
Note: See TracBrowser for help on using the repository browser.