ZipSet

A Java library for building zip files lazily

License

License

GroupId

GroupId

com.github.cilki
ArtifactId

ArtifactId

zipset
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

ZipSet
A Java library for building zip files lazily
Project URL

Project URL

https://github.com/cilki/ZipSet
Source Code Management

Source Code Management

https://github.com/cilki/ZipSet

Download zipset

Dependencies

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.28

Project Modules

There are no modules declared in this project.

Maven central Build Status codecov

ZipSet is a small zero-dependency Java library for building zip files lazily. It lets you think of a zip file like a Set that can be manipulated with standard set operations. ZipSet doesn't do any I/O until build is invoked, so all modifications are applied in a single step without the need for a temporary directory. Even the beautiful jdk.zipfs module requires changes to nested zip files be made via a temporary file.

Primary Usage

// Create a new ZipSet from an existing zip file
ZipSet zip = new ZipSet(sourceZipFile);

// Lazily add some entries
zip.add("test.txt", "1234".getBytes());     // A byte array
zip.add("test.png", Paths.get("test.png")); // A file on the filesystem
zip.add("inner.zip", anotherZipSet);        // Another ZipSet()

// Lazily add an entry to a nested zip
zip.add("inner.zip!/123.txt", Paths.get("123.txt"))

// Exclude some entries
zip.sub("delete.txt")
zip.sub("inner.zip!/example.txt");

// Output a new zip file containing all modifications in a single sweep
zip.build(outputZipFile);

Versions

Version
1.2.1
1.2.0
1.1.0
1.0.0