You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by jh...@apache.org on 2005/10/30 13:23:23 UTC
svn commit: r329552 - /ant/core/trunk/docs/manual/CoreTasks/copy.html
Author: jhm
Date: Sun Oct 30 04:23:15 2005
New Revision: 329552
URL: http://svn.apache.org/viewcvs?rev=329552&view=rev
Log:
Add two examples for copying ResourceCollections - one simple and one RC with restrict+sort.
Modified:
ant/core/trunk/docs/manual/CoreTasks/copy.html
Modified: ant/core/trunk/docs/manual/CoreTasks/copy.html
URL: http://svn.apache.org/viewcvs/ant/core/trunk/docs/manual/CoreTasks/copy.html?rev=329552&r1=329551&r2=329552&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/copy.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/copy.html Sun Oct 30 04:23:15 2005
@@ -20,13 +20,13 @@
resource collection, the <code>todir</code> attribute must be set.</p>
<p>
-<strong>Note: </strong>If you employ filters in your copy operation, you should
+<strong>Note: </strong>If you employ filters in your copy operation, you should
limit the copy to text files. Binary files will be corrupted by the copy operation.
-This applies whether the filters are implicitly defined by the
+This applies whether the filters are implicitly defined by the
<a href="filter.html">filter</a> task or explicitly provided to the copy
operation as <a href="../CoreTypes/filterset.html">filtersets</a>
</p>
-
+
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -229,13 +229,42 @@
<p><b>Collect all items from the current CLASSPATH setting into a
destination directory, flattening the directory structure.</b></p>
<pre>
- <copy todir="dest" flatten="true">
+ <copy todir="dest" flatten="true">
<path>
- <pathelement path="${java.class.path}"/>
+ <pathelement path="${java.class.path}"/>
</path>
</copy>
</pre>
+<p><b>Copies some resources to a given directory.</b></p>
+<pre>
+ <copy todir="dest" flatten="true">
+ <resources>
+ <file file="src_dir/file1.txt"/>
+ <url url="http://ant.apache.org/index.html"/>
+ </resources>
+ </copy>
+</pre>
+
+<p><b>Copies the two newest resources into a destination directory.</b></p>
+<pre>
+ <typedef name="date" classname="org.apache.tools.ant.types.resources.comparators.Date"/>
+ <copy todir="${to.dir}" flatten="true">
+ <first count="2">
+ <sort>
+ <date/>
+ <resources>
+ <file file="${from.dir}/file1.txt"/>
+ <file file="${from.dir}/file2.txt"/>
+ <file file="${from.dir}/file3.txt"/>
+ <url url="http://ant.apache.org/index.html"/>
+ </resources>
+ </sort>
+ </first>
+ </copy>
+</pre>
+
+
<p><strong>Unix Note:</strong> File permissions are not retained when files
are copied; they end up with the default <code>UMASK</code> permissions
instead. This
@@ -256,4 +285,3 @@
</body>
</html>
-
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org