英文名Coroel,读音类似“珊瑚”coral,你懂的!不懂的查海词,还有个类似读音的,CorelDraw画图软件。。。
分类: LINUX
2014-03-27 11:52:15
Commons Compress 用以实现将文件压缩或解压成 tar、zip、bzip2 等格式。
下面代码将文件压缩成zip格式:
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"));
Zip文件的解压缩:
Archive archiver = ArchiverFactory.getInstance(
new File("C:\Temp\ZIPTEST.zip"));
archiver.unpack( new File("C:\Temp\unpacked\"));
The Apache Commons Compress library defines an API for working with ar, cpio, Unix dump, tar, zip, gzip, Pack200 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.