THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
h1. Component Overview
Compress is an API for working with tar, zip and bzip2 files.
h1. Quick Start
*compress\* is divided between Compressors and Archivers. While you have to get an Archiver from a factory when just archiving one or more files to the target file (tar), you'll need a Compressor for reducing the files size (bzip2).
Please note:
There are discussion of "sponsoring" compress with code from [TrueZip] (https://truezip.dev.java.net/) and of enhancing compress design. At the moment the current implementation is considered as complex by some people. An deeper look at compress implementation can be found on the [CompressImplementationDetails] page.
h2. Archiver
To pack an archive, you have to get an archiver via the [ArchiverFactory]. At the moment it's possible to get a "zip" or a "tar" archiver. Add your files to the archiver and call save to store the archive.
h3. Packing a ZIP-File
{{{Archive archiver = [ArchiverFactory].getInstance("zip");
archiver.add( new File("C:\\Temp\\1.html"));
archiver.add( new File("C:\\Temp\\1.html.bz2"));
archiver.save( new File("C:\\Temp\\ZIPTEST.zip"));}}}
h3. Unpacking a ZIP-File
{{{Archive archiver = [ArchiverFactory].getInstance(
new File("C:\\Temp\\ZIPTEST.zip"));
archiver.unpack( new File("C:\\Temp\\unpacked\\"));}}}
h2. Compressor
Same goes for Compressor. At the moment there is only "bz2" support.
h3. Compressing a file
{{{Compressor compressor;
compressor = [CompressorFactory].getInstance("bz2");
compressor.compressToHere( new File("C:\\Temp\\test.tar"));}}}
h3. Decompressing a file
{{{Compressor decompressor;
decompressor = [CompressorFactory].getInstance("bz2");
decompressor.decompressTo( new File("C:\\Temp\\asf-logo-huge.tar.bz2"),
new File("C:\\Temp\\asf-logo-huge.tar"));}}}
h1. FAQ
|Add your questions/answers here.|
h1. TODO
- Add delete features
- Enhance implementation design