Compressed Resources

For each of the supported compression formats there is a correspondig resource that wraps around another resource providing compression or decompression on the fly. A single element resource collection must be specified as a nested element.

Resources for the formats that support files holding multiple compressed streams (bzip2, gzip and xz) support a boolean attribute decompressConcatenated. If set to true all streams will be concatenated and treated as a single resource. With the default value false only the first stream is uncompressed.

bzip2resource

This is a compressed resource using the BZIP2 compression.

This resource supports the decompressConcatenated attribute.

Examples

<cmp:tarentry xmlns:cmp="antlib:org.apache.ant.compress"
    name="some-file.txt">
  <cmp:bzip2resource>
    <file file="some-archive.tar.bz2"/>
  </cmp:bzip2resource>
</cmp:tarentry>

Represents the entry named some-file.txt in archive some-archive.tar.bz2 where the bzip2resource provides the decompression of the archive.

gzipresource

This is a compressed resource using the GZIP compression.

This resource supports the decompressConcatenated attribute.

Examples

<cmp:tarentry xmlns:cmp="antlib:org.apache.ant.compress"
    name="some-file.txt">
  <cmp:gzipresource>
    <file file="some-archive.tar.gz"/>
  </cmp:gzipresource>
</cmp:tarentry>

Represents the entry named some-file.txt in archive some-archive.tar.gz where the gzipresource provides the decompression of the archive.

pack200resource

This is a compressed resource using the Pack200 compression.

Examples

<cmp:zipentry xmlns:cmp="antlib:org.apache.ant.compress"
    name="SomeFile.class">
  <cmp:pack200resource>
    <file file="some-archive.pack"/>
  </cmp:pack200resource>
</cmp:zipentry>

Represents the entry named Somefile.class in the Pack200 compressed JAR some-archive.pack where the pack200resource provides the decompression of the archive.

xzresource

This is a compressed resource using the XZ compression.

This resource supports the decompressConcatenated attribute.

Examples

<cmp:tarentry xmlns:cmp="antlib:org.apache.ant.compress"
    name="some-file.txt">
  <cmp:xzresource>
    <file file="some-archive.tar.xz"/>
  </cmp:xzresource>
</cmp:tarentry>

Represents the entry named some-file.txt in archive some-archive.tar.xz where the xzresource provides the decompression of the archive.