@@ -1,6 +1,16 @@ | |||
Changes from Ant 1.10.0 TO Ant 1.10.1 | |||
===================================== | |||
Other changes: | |||
-------------- | |||
* new tasks <xz> and <unxz> and resource <xzresource> for XZ | |||
compression. Also the compression attribute of <tar>/<untar> now | |||
accepts "xz" as valid value. | |||
The tasks and type are contained in the new ant-xz.jar and require | |||
the library XZ for Java to be on the CLASSPATH. | |||
Bugzilla Report 60350 | |||
Changes from Ant 1.9.7 TO Ant 1.10.0 | |||
==================================== | |||
@@ -19,16 +19,22 @@ | |||
<head> | |||
<meta http-equiv="Content-Language" content="en-us"> | |||
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css"> | |||
<title>GZip/BZip2 Tasks</title> | |||
<title>GZip/BZip2/XZ Tasks</title> | |||
</head> | |||
<body> | |||
<h2><a name="pack">GZip/BZip2</a></h2> | |||
<h3>Description</h3> | |||
<p>Packs a resource using the GZip or BZip2 algorithm. | |||
<p>Packs a resource using the GZip, BZip2 or XZ algorithm. | |||
The output file is only generated if it doesn't exist or the source | |||
resource is newer.</p> | |||
<p>XZ compression support has been added with Apache Ant 1.10.1 and | |||
depends on external libraries not included in the Ant distribution. | |||
See <a href="../install.html#librarydependencies">Library | |||
Dependencies</a> for more information.</p> | |||
<h3>Parameters</h3> | |||
<table border="1" cellpadding="2" cellspacing="0"> | |||
<tr> | |||
@@ -38,7 +44,7 @@ resource is newer.</p> | |||
</tr> | |||
<tr> | |||
<td valign="top">src</td> | |||
<td valign="top">the file to gzip/bzip.</td> | |||
<td valign="top">the file to gzip/bzip/xz.</td> | |||
<td align="center" valign="top">Yes, or a nested resource collection.</td> | |||
</tr> | |||
<tr> | |||
@@ -64,6 +70,9 @@ resource collection</h4> | |||
<bzip2 src="test.tar" destfile="test.tar.bz2"/> | |||
</pre></blockquote> | |||
<blockquote><pre> | |||
<xz src="test.tar" destfile="test.tar.xz"/> | |||
</pre></blockquote> | |||
<blockquote><pre> | |||
<gzip destfile="archive.tar.gz"> | |||
<url url="http://example.org/archive.tar"/> | |||
</gzip> | |||
@@ -24,17 +24,22 @@ | |||
<body> | |||
<h2><a name="unpack">GUnzip/BUnzip2</a></h2> | |||
<h2><a name="unpack">GUnzip/BUnzip2/UnXZ</a></h2> | |||
<h3>Description</h3> | |||
<p>Expands a resource packed using GZip or BZip2.</p> | |||
<p>Expands a resource packed using GZip, BZip2 or XZ.</p> | |||
<p>If <i>dest</i> is a directory the name of the destination file is | |||
the same as <i>src</i> (with the ".gz" or ".bz2" | |||
the same as <i>src</i> (with the ".gz", ".bz2" or ".xz" | |||
extension removed if present). If <i>dest</i> is omitted, the parent | |||
dir of <i>src</i> is taken. The file is only expanded if the source | |||
resource is newer than the destination file, or when the destination file | |||
does not exist.</p> | |||
<p>XZ compression support has been added with Apache Ant 1.10.1 and | |||
depends on external libraries not included in the Ant distribution. | |||
See <a href="../install.html#librarydependencies">Library | |||
Dependencies</a> for more information.</p> | |||
<h3>Parameters</h3> | |||
<table border="1" cellpadding="2" cellspacing="0"> | |||
<tr> | |||
@@ -70,6 +75,10 @@ resource collection</h4> | |||
</pre></blockquote> | |||
<p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p> | |||
<blockquote><pre> | |||
<uncz src="test.tar.xz"/> | |||
</pre></blockquote> | |||
<p>expands <i>test.tar.xz</i> to <i>test.tar</i></p> | |||
<blockquote><pre> | |||
<gunzip src="test.tar.gz" dest="test2.tar"/> | |||
</pre></blockquote> | |||
<p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p> | |||
@@ -104,12 +113,12 @@ is identical to | |||
</pre> | |||
<p>The same is also true for <code><bunzip2></code> and | |||
<code><bzip2resource></code>. <code><copy></code> offers | |||
additional features like <a | |||
href="../Types/filterchain.html">filtering files</a> on the fly, | |||
allowing a file to be mapped to multiple destinations, preserving the | |||
last modified time or a configurable file system timestamp | |||
granularity.</p> | |||
<code><bzip2resource></code> or <code>%lt;unxz></code> | |||
and <code>%lt;xzresource></code>. <code><copy></code> offers | |||
additional features like <a href="../Types/filterchain.html">filtering | |||
files</a> on the fly, allowing a file to be mapped to multiple | |||
destinations, preserving the last modified time or a configurable file | |||
system timestamp granularity.</p> | |||
@@ -49,6 +49,7 @@ explicit use beginning in <b>Ant 1.7</b>. | |||
<li><a href="#string">string</a> - a text string.</li> | |||
<li><a href="#tarentry">tarentry</a> - an entry in a tar file.</li> | |||
<li><a href="#url">url</a> - a URL.</li> | |||
<li><a href="#xzresource">xzresource</a> - an XZ compressed resource.</li> | |||
<li><a href="#zipentry">zipentry</a> - an entry in a zip file.</li> | |||
</ul> | |||
@@ -277,6 +278,18 @@ resource providing compression of the resource's contents on the fly. | |||
A single element resource collection must be specified as a nested | |||
element.</p> | |||
<h4><a name="xzresource">xzresource</a></h4> | |||
<p>This is not a stand-alone resource, but a wrapper around another | |||
resource providing compression of the resource's contents on the fly. | |||
A single element resource collection must be specified as a nested | |||
element.</p> | |||
<p>XZ compression support has been added with Apache Ant 1.10.1 and | |||
depends on external libraries not included in the Ant distribution. | |||
See <a href="../install.html#librarydependencies">Library | |||
Dependencies</a> for more information.</p> | |||
<h4><a name="url">url</a></h4> | |||
<p>Represents a URL.</p> | |||
@@ -1018,6 +1018,12 @@ you need jakarta-oro 2.0.8 or later, and <a href="#commons-net">commons-net</a>< | |||
<td><a href="https://jai.dev.java.net/" | |||
target="_top">https://jai.dev.java.net/</a></td> | |||
</tr> | |||
<tr> | |||
<td>XZ - XZ for Java <b>1.6 or later</b></td> | |||
<td>xz and unxz tasks, xzresource, xz compression in tar/untar</td> | |||
<td><a href="http://www.tukaani.org/xz/java.html" | |||
target="_top">http://www.tukaani.org/xz/java.html</a></td> | |||
</tr> | |||
</table> | |||
<br> | |||
<h2><a name="Troubleshooting">Troubleshooting</a></h2> | |||
@@ -178,6 +178,7 @@ | |||
<li><a href="Tasks/unzip.html">Unjar</a></li> | |||
<li><a href="Tasks/unzip.html">Untar</a></li> | |||
<li><a href="Tasks/unzip.html">Unwar</a></li> | |||
<li><a href="Tasks/unpack.html">UnXZ</a></li> | |||
<li><a href="Tasks/unzip.html">Unzip</a></li> | |||
<li><a href="Tasks/uptodate.html">Uptodate</a></li> | |||
<li><a href="Tasks/verifyjar.html">VerifyJar</a></li> | |||
@@ -188,6 +189,7 @@ | |||
<li><a href="Tasks/wljspc.html">Weblogic JSP Compiler</a></li> | |||
<li><a href="Tasks/xmlproperty.html">XmlProperty</a></li> | |||
<li><a href="Tasks/xmlvalidate.html">XmlValidate</a></li> | |||
<li><a href="Tasks/pack.html">XZ</a></li> | |||
<li><a href="Tasks/style.html">XSLT/<i>Style</i></a></li> | |||
<li><a href="Tasks/zip.html">Zip</a></li> | |||
</ul> | |||
@@ -67,13 +67,13 @@ documentation.</p> | |||
</tr> | |||
<tr valign="top"> | |||
<td nowrap><a href="Tasks/unpack.html">BUnzip2</a></td> | |||
<td><p>Expands a file packed using GZip or BZip2.</p></td> | |||
<td nowrap><a href="Tasks/unpack.html">GUnzip/BUnzip2/UnXZ</a></td> | |||
<td><p>Expands a file packed using GZip, BZip2 or XZ.</p></td> | |||
</tr> | |||
<tr valign="top"> | |||
<td nowrap><a href="Tasks/pack.html">BZip2</a></td> | |||
<td><p>Packs a file using the GZip or BZip2 algorithm. This task | |||
<td nowrap><a href="Tasks/pack.html">GZip/BZip2/XZ</a></td> | |||
<td><p>Packs a file using the GZip, BZip2 or XZ algorithm. This task | |||
does not do any dependency checking; the output file is always | |||
generated</p></td> | |||
</tr> | |||
@@ -18,13 +18,13 @@ | |||
package org.apache.tools.ant.taskdefs; | |||
import java.lang.reflect.Constructor; | |||
import java.lang.reflect.InvocationTargetException; | |||
import java.io.BufferedInputStream; | |||
import java.io.File; | |||
import java.io.FileInputStream; | |||
import java.io.IOException; | |||
import java.io.InputStream; | |||
import java.lang.reflect.Constructor; | |||
import java.lang.reflect.InvocationTargetException; | |||
import java.util.zip.GZIPInputStream; | |||
import org.apache.tools.ant.BuildException; | |||
@@ -72,6 +72,7 @@ public class Untar extends Expand { | |||
* <li>none - no compression | |||
* <li>gzip - Gzip compression | |||
* <li>bzip2 - Bzip2 compression | |||
* <li>xz - XZ compression, requires XZ for Java | |||
* </ul> | |||
* | |||
* @param method compression method | |||