java zip 压缩 第三方库,zt-zip:一个java 压缩和解压库

ZIP - convenience methodsContinuous IntegrationQuick OverviewThe project was started and coded by Rein Raudjärv when he needed to process a large set of large ZIP archives for LiveRebel internals. Soo...
摘要由CSDN通过智能技术生成

ZIP - convenience methods

Continuous Integration

Quick Overview

The project was started and coded by Rein Raudjärv when he needed to process a large set of large ZIP archives for LiveRebel internals. Soon after we started using the utility in other projects because of the ease of use and it just worked.

The project is built using java.util.zip.* packages for stream based access. Most convenience methods for filesystem usage is also supported.

Installation

The project artifacts are available in Maven Central Repository. To include it in your maven project then you have to specify the dependency.

...

org.zeroturnaround

zt-zip

1.10

jar

...

Notice that 1.8 is the last Java 1.4 compatible release. Since then Java 1.5 is required.

Background

We had the following functional requirements:

pack and unpack directories recursively

include/exclude entries

rename entries

packing/unpacking in place - ZIP becomes directory and vice versa

iterate through ZIP entries

add or replace entries from files or byte arrays

transform ZIP entries

compare two archives - compare all entries ignoring time stamps

and these non-functional requirements:

use existing APIs as much as possible

be simple to use

be effective to use - do not traverse an entire ZIP file if only a single entry is needed

be safe to use - do not enable user to leave streams open and keep files locked

do not declare exceptions

be compatible with Java 1.5

Examples

Unpacking

Check if an entry exists in a ZIP archive

boolean exists = ZipUtil.containsEntry(new File("/tmp/demo"), "foo.txt");

Extrac

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值