1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Get Task</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="get">Get</a></h2>
|
---|
12 | <h3>Description</h3>
|
---|
13 | <p>Gets a file from a URL. When the verbose option is "on", this task
|
---|
14 | displays a '.' for every 100 Kb retrieved. Any URL schema supported by
|
---|
15 | the runtime is valid here, including http:, ftp: and jar:;
|
---|
16 | https: is only valid if the appropriate support is added to the pre-1.4 Java
|
---|
17 | runtimes.
|
---|
18 |
|
---|
19 | </p>
|
---|
20 | <p>This task should be preferred above the <a href="cvs.html">CVS task</a> when
|
---|
21 | fetching remote content. CVS is significantly slower than loading a compressed
|
---|
22 | archive compared to http/ftp.</p>
|
---|
23 |
|
---|
24 | The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
|
---|
25 | only fetched if newer than the local copy. If there is no local copy, the download always takes
|
---|
26 | place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
|
---|
27 | if the JVM is Java1.2 or later.
|
---|
28 | NB: This timestamp facility only works on downloads using the HTTP protocol.
|
---|
29 | <p>
|
---|
30 | A username and password can be specified, in which case basic 'slightly encoded
|
---|
31 | plain text' authentication is used. This is only a secure authentication
|
---|
32 | mechanism over an HTTPS link.
|
---|
33 | <p>
|
---|
34 | If you need to go through a firewall, use
|
---|
35 | <a href="../OptionalTasks/setproxy.html"><setproxy></a>
|
---|
36 | to set up the proxy first.
|
---|
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">src</td>
|
---|
48 | <td valign="top">the URL from which to retrieve a file.</td>
|
---|
49 | <td align="center" valign="top">Yes</td>
|
---|
50 | </tr>
|
---|
51 | <tr>
|
---|
52 | <td valign="top">dest</td>
|
---|
53 | <td valign="top">the file where to store the retrieved file.</td>
|
---|
54 | <td align="center" valign="top">Yes</td>
|
---|
55 | </tr>
|
---|
56 | <tr>
|
---|
57 | <td valign="top">verbose</td>
|
---|
58 | <td valign="top">show verbose progress information ("on"/"off").</td>
|
---|
59 | <td align="center" valign="top">No; default "false"</td>
|
---|
60 | </tr>
|
---|
61 | <tr>
|
---|
62 | <td valign="top">ignoreerrors</td>
|
---|
63 | <td valign="top">Log errors but don't treat as fatal.</td>
|
---|
64 | <td align="center" valign="top">No; default "false"</td>
|
---|
65 | </tr>
|
---|
66 | <tr>
|
---|
67 | <td valign="top">usetimestamp</td>
|
---|
68 | <td valign="top">conditionally download a file based on the timestamp of the
|
---|
69 | local copy. HTTP only</td>
|
---|
70 | <td align="center" valign="top">No; default "false"</td>
|
---|
71 | </tr>
|
---|
72 | <tr>
|
---|
73 | <td valign="top">username</td>
|
---|
74 | <td valign="top">username for 'BASIC' http authentication</td>
|
---|
75 | <td align="center" valign="top">if password is set</td>
|
---|
76 | </tr>
|
---|
77 | <tr>
|
---|
78 | <td valign="top">password</td>
|
---|
79 | <td valign="top">password: required </td>
|
---|
80 | <td align="center" valign="top">if username is set</td>
|
---|
81 | </tr>
|
---|
82 |
|
---|
83 | </table>
|
---|
84 | <h3>Examples</h3>
|
---|
85 | <pre> <get src="http://ant.apache.org/" dest="help/index.html"/></pre>
|
---|
86 | <p>Gets the index page of http://ant.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
|
---|
87 |
|
---|
88 | <pre> <get src="http://www.apache.org/dist/ant/KEYS"
|
---|
89 | dest="KEYS"
|
---|
90 | verbose="true"
|
---|
91 | usetimestamp="true"/></pre>
|
---|
92 | <p>
|
---|
93 | Gets the PGP keys of Ant's (current and past) release managers, if the local copy
|
---|
94 | is missing or out of date. Uses the verbose option
|
---|
95 | for progress information.
|
---|
96 | </p>
|
---|
97 |
|
---|
98 | <pre> <get src="https://insecure-bank.org/statement/user=1214"
|
---|
99 | dest="statement.html"
|
---|
100 | username="1214";
|
---|
101 | password="secret"/></pre>
|
---|
102 | <p>
|
---|
103 | Fetches some file from a server with access control. Because https is being used the
|
---|
104 | fact that basic auth sends passwords in plaintext is moot.
|
---|
105 | <hr>
|
---|
106 | <p align="center">Copyright © 2000-2004 The Apache Software Foundation. All rights
|
---|
107 | Reserved.</p>
|
---|
108 |
|
---|
109 | </body>
|
---|
110 | </html>
|
---|
111 |
|
---|