Component Overview

Compress is an API for working with the various archiving and compression formats.

Quick Start

*compress* is a stream based API. Some of it's original code came from Avalon's Excalibur, but originally from Ant, as far as life in Apache goes. It has migrated via: Ant -> Avalon-Excalibur -> Commons-IO -> Commons-Compress. More credits can be found in NOTICE.txt file.

*compress* divides the implementation in Compressors and Archivers. For each one an factory is implemented. Basically you have to get the stream implementation from the factory, create an entry, put this into the stream and stream.

Some experimental code makes it possible to modify archiver and compressor files. This means you can delete from for example a zip file.

Historical notes: There were discussion of "sponsoring" compress with code from TrueZip (https://truezip.dev.java.net/). The result was, not to include any code from this project (see mailinglists). There was a discussion about the complex file based implementation too. The result was to start again with a stream based implementation and move the old one to a branch. More information about the old implementation can be found on the CompressImplementationDetails page.

Roadmap

We're currenlty discussing a 2.0 API that fully embraces generics and tries to address a few pain points discovered over the years Compress 1.x has been around. If you want to help, here is the CompressRoadmap.

Archiver

To pack an archive, you have to get an archiver stream via the ArchiverFactory. Add your streams to the archiver and stream. Archiver streams are: ZIP, CPIO, AR, TAR, JAR, DUMP. 7z, ARJ.

Creating a ZIP-File

Unpacking a ZIP-File

Compressor

Same goes for Compressor. Compressor streams are: bz2, gz, lzma, xz, pack200, Z.

Compressing a file

Decompressing a file

FAQ

Compress (last edited 2013-12-07 19:53:17 by StefanBodewig)