Author: bodewig
Date: Wed Sep 9 11:04:09 2009
New Revision: 812884
URL: http://svn.apache.org/viewvc?rev=812884&view=rev
Log:
document unarchival tasks
Added:
ant/sandbox/antlibs/compress/trunk/docs/expand.html (contents, props
changed)
- copied, changed from r812756,
ant/core/trunk/docs/manual/CoreTasks/unzip.html
Copied: ant/sandbox/antlibs/compress/trunk/docs/expand.html (from r812756,
ant/core/trunk/docs/manual/CoreTasks/unzip.html)
URL:
http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/docs/expand.html?p2=ant/sandbox/antlibs/compress/trunk/docs/expand.html&p1=ant/core/trunk/docs/manual/CoreTasks/unzip.html&r1=812756&r2=812884&rev=812884&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/unzip.html (original)
+++ ant/sandbox/antlibs/compress/trunk/docs/expand.html Wed Sep 9 11:04:09 2009
@@ -18,52 +18,35 @@
<head>
<meta http-equiv="Content-Language" content="en-us">
-<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
-<title>Unzip Task</title>
+<link rel="stylesheet" type="text/css" href="style.css">
+<title>Unarchiving Task</title>
</head>
<body>
-<h2><a name="unzip">Unjar/Untar/Unwar/Unzip</a></h2>
-<h3>Description</h3>
-<p>Unzips a zip-, war-, or jar file.</p>
-<p><a href="../CoreTypes/patternset.html">PatternSet</a>s are used to select
files to extract
-<I>from</I> the archive. If no patternset is used, all files are extracted.
-</p>
+<h2><a name="expand">Unarchiving Tasks</a></h2>
-<p><a href="../CoreTypes/resources.html#collection">Resource
-Collection</a>s may be used to select archived files to perform
-unarchival upon. Only file system based resource collections are
-supported by Unjar/Unwar/Unzip, this includes <a
-href="../CoreTypes/fileset.html">fileset</a>, <a
-href="../CoreTypes/filelist.html">filelist</a>, <a
-href="../using.html#path">path</a>, and <a
-href="../CoreTypes/resources.html#files">files</a>.
-Untar supports arbitrary resource collections.
-Prior to Ant 1.7 only fileset has been supported as a nested element.</p>
+<p>For each of the supported archiving formats there is a
+ correspondig <code>unarchiving</code> task. These tasks are based
+ on
+ their <a href="http://ant.apache.org/manual/CoreTasks/unzip.html">core
+ cousin tasks</a>.</p>
-<p>You can define filename transformations by using a nested <a
href="../CoreTypes/mapper.html">mapper</a> element. The default mapper is the
-<a href="../CoreTypes/mapper.html#identity-mapper">identity mapper</a>.
+<p><a
href="http://ant.apache.org/manual/CoreTypes/patternset.html">PatternSet</a>s
are used to select files to extract
+<I>from</I> the archive. If no patternset is used, all files are extracted.
</p>
-<p>File permissions will not be restored on extracted files.</p>
-<p>The untar task recognizes the long pathname entries used by GNU tar.<p>
-<p><b>Please note</b> that different ZIP tools handle timestamps
-differently when it comes to applying timezone offset calculations of
-files. Some ZIP libraries will store the timestamps as they've been
-read from the filesystem while others will modify the timestamps both
-when reading and writing the files to make all timestamps use the same
-timezone. A ZIP archive created by one library may extract files with
-"wrong timestamps" when extracted by another library.</p>
+<p><a
href="http://ant.apache.org/manual/CoreTypes/resources.html#collection">Resource
+Collection</a>s may be used to select archived files to perform
+unarchival upon.</p>
-<p>Ant's ZIP classes use the same algorithm as the InfoZIP tools and
-zlib (timestamps get adjusted), Windows' "compressed folders" function
-and WinZIP don't change the timestamps. This means that using the
-unzip task on files created by Windows' compressed folders function
-may create files with timestamps that are "wrong", the same is true if
-you use Windows' functions to extract an Ant generated ZIP
-archive.</p>
+<p>You can define filename transformations by using a
+nested <a href="http://ant.apache.org/manual/CoreTypes/mapper.html">mapper</a>
+element. The default mapper is the
+<a
href="http://ant.apache.org/manual/CoreTypes/mapper.html#identity-mapper">identity
+mapper</a>.</p>
+<p>File permissions will not be restored on extracted files.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
@@ -90,13 +73,65 @@
<td align="center" valign="top">No</td>
</tr>
<tr>
- <td valign="top">compression</td>
- <td valign="top"><b>Note:</b> This attribute is only available for
- the <code>untar</code> task.<br>
- compression method. Allowable values are "none",
- "gzip" and "bzip2". Default is
- "none".</td>
- <td valign="top" align="center">No</td>
+ <td valign="top">failOnEmptyArchive</td>
+ <td valign="top">whether trying to extract an empty archive is an
+ error.</td>
+ <td valign="top" align="center">No, defaults to false</td>
+ </tr>
+ <tr>
+ <td valign="top">stripAbsolutePathSpec</td>
+ <td valign="top">whether Ant should remove leading '/' or '\'
+ characters from the extracted file name before extracing it.
+ Note that this changes the entry's name before applying
+ include/exclude patterns and before using the nested mappers (if
+ any).</td>
+ <td valign="top" align="center">No, defaults to false</td>
+ </tr>
+</table>
+
+<h3><a name="unar">UnAr</a></h3>
+
+<p>An <a href="#expand">unarchiving task</a> for AR archives.</p>
+
+<h3><a name="uncpio">UnCpio</a></h3>
+
+<p>An <a href="#expand">unarchiving task</a> for CPIO archives.</p>
+
+<h3><a name="untar">UnTar</a></h3>
+
+<p>An <a href="#expand">unarchiving task</a> for TAR archives.</p>
+
+<h3><a name="unzip">UnZip</a></h3>
+
+<p>An <a href="#expand">unarchiving task</a> for ZIP archives.</p>
+
+<p><b>Please note</b> that different ZIP tools handle timestamps
+differently when it comes to applying timezone offset calculations of
+files. Some ZIP libraries will store the timestamps as they've been
+read from the filesystem while others will modify the timestamps both
+when reading and writing the files to make all timestamps use the same
+timezone. A ZIP archive created by one library may extract files with
+"wrong timestamps" when extracted by another library.</p>
+
+<p>Apache Commons Compress' ZIP classes use the same algorithm as the
+InfoZIP tools and zlib (timestamps get adjusted), Windows' "compressed
+folders" function and WinZIP don't change the timestamps. This means
+that using the unzip task on files created by Windows' compressed
+folders function may create files with timestamps that are "wrong",
+the same is true if you use Windows' functions to extract an Ant
+generated ZIP archive.</p>
+
+<p>In addition to the parameters above, the unzip tasks supports the
+ following attributes:</p>
+
+<p>Unlike its counterpart in Ant's core this Antlib's task can also
+ extract archives that are not file system resources.</p>
+
+<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">encoding</td>
@@ -113,21 +148,6 @@
<td align="center" valign="top">No</td>
</tr>
<tr>
- <td valign="top">failOnEmptyArchive</td>
- <td valign="top">whether trying to extract an empty archive is an
- error. <em>since Ant 1.8.0</em></td>
- <td valign="top" align="center">No, defaults to false</td>
- </tr>
- <tr>
- <td valign="top">stripAbsolutePathSpec</td>
- <td valign="top">whether Ant should remove leading '/' or '\'
- characters from the extracted file name before extracing it.
- Note that this changes the entry's name before applying
- include/exclude patterns and before using the nested mappers (if
- any). <em>since Ant 1.8.0</em></td>
- <td valign="top" align="center">No, defaults to false</td>
- </tr>
- <tr>
<td valign="top">scanForUnicodeExtraFields</td>
<td valign="top"><b>Note:</b> This attribute is not available for
the <code>untar</code> task.<br>
@@ -138,27 +158,32 @@
<td align="center" valign="top">No, defaults to true</td>
</tr>
</table>
+
<h3>Examples</h3>
<pre>
-<unzip src="${tomcat_src}/tools-src.zip"
dest="${tools.home}"/>
+<cmp:unzip src="${tomcat_src}/tools-src.zip"
+ dest="${tools.home}"
+ xmlns:cmp="antlib:org.apache.ant.compress"/>
</pre>
<p>
<pre>
-<gunzip src="tools.tar.gz"/>
-<untar src="tools.tar" dest="${tools.home}"/>
+<cmp:gunzip src="tools.tar.gz"
xmlns:cmp="antlib:org.apache.ant.compress"/>
+<cmp:untar src="tools.tar" dest="${tools.home}"
+ xmlns:cmp="antlib:org.apache.ant.compress"/>
</pre>
<pre>
-<unzip src="${tomcat_src}/tools-src.zip"
+<cmp:unzip src="${tomcat_src}/tools-src.zip"
+ xmlns:cmp="antlib:org.apache.ant.compress"
dest="${tools.home}">
<patternset>
<include name="**/*.java"/>
<exclude name="**/Test*.java"/>
</patternset>
-</unzip>
+</cmp:unzip>
</pre>
<p>
<pre>
-<unzip dest="${tools.home}">
+<cmp:unzip dest="${tools.home}
xmlns:cmp="antlib:org.apache.ant.compress"">
<patternset>
<include name="**/*.java"/>
<exclude name="**/Test*.java"/>
@@ -167,74 +192,79 @@
<include name="**/*.zip"/>
<exclude name="**/tmp*.zip"/>
</fileset>
-</unzip>
+</cmp:unzip>
</pre>
<p>
<pre>
-<unzip src="apache-ant-bin.zip" dest="${tools.home}">
+<cmp:unzip src="apache-ant-bin.zip"
+ dest="${tools.home}"
+ xmlns:cmp="antlib:org.apache.ant.compress">
<patternset>
<include name="apache-ant/lib/ant.jar"/>
</patternset>
<mapper type="flatten"/>
-</unzip>
+</cmp:unzip>
</pre>
<h3>Related tasks</h3>
<pre>
-<unzip src="some-archive" dest="some-dir">
+<cmp:unzip src="some-archive" dest="some-dir"
xmlns:cmp="antlib:org.apache.ant.compress">
<patternset>
<include name="some-pattern"/>
</patternset>
<mapper type="some-mapper"/>
-</unzip>
+</cmp:unzip>
</pre>
is identical to
<pre>
<copy todir="some-dir" preservelastmodified="true">
- <zipfileset src="some-archive">
+ <cmp:zipfileset src="some-archive"
xmlns:cmp="antlib:org.apache.ant.compress">
<patternset>
<include name="some-pattern"/>
</patternset>
- </zipfileset>
+ </cmp:zipfileset>
<mapper type="some-mapper"/>
</copy>
</pre>
<p>The same is also true for <code><untar></code> and
<code><tarfileset></code>. <code><copy></code> offers
-additional features like <a href="../CoreTypes/filterchain.html">filtering
files</a> on the fly,
-allowing a file to be mapped to multiple destinations or a
-configurable file system timestamp granularity.</p>
+additional features
+like <a
href="http://ant.apache.org/manual/CoreTypes/filterchain.html">filtering
+files</a> on the fly, allowing a file to be mapped to multiple
+destinations or a configurable file system timestamp granularity.</p>
-<pre><zip destfile="new.jar">
- <zipfileset src="old.jar">
+<pre><cmp:zip destfile="new.jar"
xmlns:cmp="antlib:org.apache.ant.compress">
+ <cmp:zipfileset src="old.jar">
<exclude name="do/not/include/this/class"/>
- </zipfileset>
-</zip>
+ </cmp:zipfileset>
+</cmp:zip>
</pre>
<p>"Deletes" files from a zipfile.</p>
<pre>
-<unzip src="${ant.home}/lib/ant.jar" dest="...">
+<cmp:unzip src="${ant.home}/lib/ant.jar"
+ dest="..." xmlns:cmp="antlib:org.apache.ant.compress">
<patternset>
<include name="images/"/>
</patternset>
-</unzip>
+</cmp:unzip>
</pre>
<p>This extracts all images from <tt>ant.jar</tt> which are stored in the
<tt>images</tt> directory
of the Jar (or somewhere under it). While extracting the directory structure
(<tt>images</tt>)
will be taken.</p>
<pre>
-<unzip src="${ant.home}/lib/ant.jar" dest="...">
+<cmp:unzip src="${ant.home}/lib/ant.jar"
+ dest="..." xmlns:cmp="antlib:org.apache.ant.compress">
<patternset>
<include name="**/ant_logo_large.gif"/>
<include name="**/LICENSE.txt"/>
</patternset>
-</unzip>
+</cmp:unzip>
</pre>
<p>This extracts the two files <tt>ant_logo_large.gif</tt> and
<tt>LICENSE.txt</tt> from the
<tt>ant.jar</tt>. More exactly: it extracts all files with these names from
anywhere in the source file. While extracting the directory structure will be
taken.</p>
Propchange: ant/sandbox/antlibs/compress/trunk/docs/expand.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/sandbox/antlibs/compress/trunk/docs/expand.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: ant/sandbox/antlibs/compress/trunk/docs/expand.html
------------------------------------------------------------------------------
svn:mergeinfo =