blob: 7337de5d2be8049b893ed0b683926f8f6ca413d1 [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Ant User Manual</title>
</head>
<body>
<h2><a name="get">Get</a></h2>
<h3>Description</h3>
<p>Gets a file from a URL. When the verbose option is &quot;on&quot;, this task
displays a '.' for every 100 Kb retrieved.</p>
<p>This task should be preferred above the <a href="cvs.html">CVS task</a> when
doing automated builds. CVS is significantly slower than loading a compressed
archive with http/ftp.</p>
The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
only fetched if newer than the local copy. If there is no local copy, the download always takes
place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
if the JVM is Java1.2 or later.
NB: This timestamp facility only works on downloads using the HTTP protocol.
<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">src</td>
<td valign="top">the URL from which to retrieve a file.</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top">dest</td>
<td valign="top">the file where to store the retrieved file.</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">ignoreerrors</td>
<td valign="top">Log errors but don't treat as fatal.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">usetimestamp</td>
<td valign="top">conditionally download a file based on the timestamp of the local copy.
HTTP only</td>
<td align="center" valign="top">No</td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;get src=&quot;http://jakarta.apache.org/&quot; dest=&quot;help/index.html&quot;/&gt;</pre>
<p>Gets the index page of http://jakarta.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
<pre> &lt;get src=&quot;http://jakarta.apache.org/builds/tomcat/nightly/ant.zip&quot;
dest=&quot;optional.jar&quot;
verbose=&quot;true&quot;
usetimestamp=&quot;true&quot;/&gt;</pre>
<p>
Gets the nightly ant build from the tomcat distribution, if the local copy
is missing or out of date. Uses the verbose option
for progress information.
</p>
<hr>
<p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
Reserved.</p>
</body>
</html>