[14982] | 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 "on", this task
|
---|
| 30 | displays a '.' for every 100 Kb retrieved. Any URL schema supported by
|
---|
| 31 | the runtime is valid here, including http:, ftp: and jar:;
|
---|
| 32 | https: is only valid if the appropriate support is added to the pre-1.4 Java
|
---|
| 33 | runtimes.
|
---|
| 34 |
|
---|
| 35 | </p>
|
---|
| 36 | The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
|
---|
| 37 | only fetched if newer than the local copy. If there is no local copy, the download always takes
|
---|
| 38 | place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
|
---|
| 39 | if the JVM is Java1.2 or later.
|
---|
| 40 | NB: This timestamp facility only works on downloads using the HTTP protocol.
|
---|
| 41 | <p>
|
---|
| 42 | A username and password can be specified, in which case basic 'slightly encoded
|
---|
| 43 | plain 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"><setproxy></a> task for
|
---|
| 50 | earlier Java versions. With proxies turned on, <code><get></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 ("on"/"off").</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> <get src="http://ant.apache.org/" dest="help/index.html"/></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> <get src="http://www.apache.org/dist/ant/KEYS"
|
---|
| 105 | dest="KEYS"
|
---|
| 106 | verbose="true"
|
---|
| 107 | usetimestamp="true"/></pre>
|
---|
| 108 | <p>
|
---|
| 109 | Gets the PGP keys of Ant's (current and past) release managers, if the local copy
|
---|
| 110 | is missing or out of date. Uses the verbose option
|
---|
| 111 | for progress information.
|
---|
| 112 | </p>
|
---|
| 113 |
|
---|
| 114 | <pre> <get src="https://insecure-bank.org/statement/user=1214"
|
---|
| 115 | dest="statement.html"
|
---|
| 116 | username="1214";
|
---|
| 117 | password="secret"/></pre>
|
---|
| 118 | <p>
|
---|
| 119 | Fetches some file from a server with access control. Because https is being used the
|
---|
| 120 | fact that basic auth sends passwords in plaintext is moot.
|
---|
| 121 |
|
---|
| 122 |
|
---|
| 123 | </body>
|
---|
| 124 | </html>
|
---|
| 125 |
|
---|