Author: bodewig
Date: Wed Aug 26 10:04:31 2009
New Revision: 807950

URL: http://svn.apache.org/viewvc?rev=807950&view=rev
Log:
show how to combine checksum and get to achieve PR 44662

Modified:
    ant/core/trunk/docs/manual/CoreTasks/get.html

Modified: ant/core/trunk/docs/manual/CoreTasks/get.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/get.html?rev=807950&r1=807949&r2=807950&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/get.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/get.html Wed Aug 26 10:04:31 2009
@@ -141,6 +141,31 @@
 readable by third parties.  If you need more security, consider using
 the <a href="input.html">input task</a> to query for a password.</p>
 
+<p>Using a macro like the following</p>
+
+<pre>
+  &lt;macrodef name="get-and-checksum">
+    &lt;attribute name="url"/>
+    &lt;attribute name="dest"/>
+    &lt;sequential>
+      &lt;get src="@{url}" dest="@{dest}"/>
+      &lt;get src="@{url}.sha1" dest="@{dest}.sha"/>
+      &lt;local name="checksum.matches"/>
+      &lt;local name="checksum.matches.fail"/>
+      &lt;checksum file="@{dest}" algorithm="sha" fileext=".sha"
+                verifyproperty="checksum.matches"/>
+      &lt;condition property="checksum.matches.fail">
+        &lt;equals arg1="${checksum.matches}" arg2="false"/>
+      &lt;/condition>
+      &lt;fail if="checksum.matches.fail">Checksum error&lt;/fail>
+    &lt;/sequential>
+  &lt;/macrodef>
+</pre>
+
+<p>it is possible to download an artifacts together with its SHA1
+  checksum (assuming a certain naming convention for the checksum
+  file, of course) and validate the checksum on the fly.</p>
+
 </body>
 </html>
 


Reply via email to