Commons Compress

Commons Compress defines an API for working with ar, cpio, tar, zip, gzip and bzip2 files.

The code in this component has many origins:

  • The bzip2, tar and zip support came from Avalon's Excalibur, but originally from Ant, as far as life in Apache goes. The tar package is originally Tim Endres' public domain package. The bzip2 package is based on the work done by Keiron Liddle. It has migrated via:
    Ant -> Avalon-Excalibur -> Commons-IO -> Commons-Compress.
  • The cpio package has been contributed by Markus Kuss and the jRPM project
  • .

Status

  • This component has been promoted to Commons proper
  • The code has been released as version 1.0

Documentation

Commons Compress requires Java 1.4 or later.

The compress component is split into compressors and archivers. While compressors (un)compress streams that usually store a single entry, archivers deal with archives that contain structured content represented by ArchiveEntry instances which in turn usually correspond to single files or directories.

Currently the bzip2 and gzip formats are supported as compressors where gzip support is provided by the java.util.zip package of the Java class library.

The ar, cpio, tar and zip formats are supported as archivers where the zip implementation provides capabilities that go beyond the features found in java.util.zip.

The compress component provides abstract base classes for compressors and archivers together with factories that can be used to choose implementations by algorithm name. In the case of input streams the factories can also be used to guess the format and provide the matching implementation.

Releases

None.