[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [Jakarta-commons Wiki] Update of "Compress" by ChristianGrobmeier
From:       Apache Wiki <wikidiffs () apache ! org>
Date:       2006-07-31 12:52:14
Message-ID: 20060731125214.9535.80040 () ajax ! apache ! org
[Download RAW message or body]

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" for \
change notification.

The following page has been changed by ChristianGrobmeier:
http://wiki.apache.org/jakarta-commons/Compress

------------------------------------------------------------------------------
  ##language:en
  = Component Overview =
- 
  Compress is an API for working with tar, zip and bzip2 files.
  
- = External Resources =
+ = Quick Start =
+ *compress* is divided between Compressors and Archivers. 
  
-  ||Do you have a good example, add it here!||
+ == 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. + 
+ === 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"));
+ 
+ === Unpacking a ZIP-File ===
+ 	Archive archiver = ArchiverFactory.getInstance(
+ 				new File("C:\\Temp\\ZIPTEST.zip"));
+ 		archiver.unpack( new File("C:\\Temp\\unpacked\\"));
+ 
+ == Compressor ==
+ Same goes for Compressor. At the moment there is only "bz2" support.
+ 
+ === Compressing a file ===
+ 	Compressor compressor;
+ 	compressor = CompressorFactory.getInstance("bz2");
+ 	compressor.compressToHere( new File("C:\\Temp\\test.tar"));
+ 
+ === 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"));
  
  = FAQ =
  
   ||Add your questions/answers here.||
  
  = TODO =
+ - Add delete features
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic