/vavi-util-archive

🗜️ Integrated Archiving method and Compressed stream SPI for Java (zip, lha, cab, gzip, etc...)

Primary LanguageJava

Java CI CodeQL Java

vavi-util-archive

🌏 Extract the world!

extract all archive types in the same way!
archives are able to mount as fuse also using vavi-nio-file-archive and vavi-net-fuse

Status

name mathod read write comment library
binhex archiving - binhex
bzip2 archiving - commons-compress
cab archiving - dorkbox
gca archiving - - win only native
gca archiving - - shell
gzip archiving - jdk
lha archiving - lha
rar archiving - - win only native
rar archiving - - shell
rar archiving ✅* - java-unrar
rar archiving - no rar5 junrar
sevenzip archiving - 7z only commons-compress
sevenzip archiving - - native
stuffit archiving - native
tar archiving - commons-compress
tar stream - commons-compress
zip archiving ✅* - jdk
zip archiving - ant
cpio stream 🚧 - gjt
lzma stream 🚧 - p7zip
rpm archiving 🚧 - gjt
apache archiving - multi commons-compress

* chosen as spi

Install

Usage

archive extraction

    Archive archive = Archives.getArchive(Paths.get("foo/bar.rar").toFile());
    Path outDir = Paths.get("foo/bar");
    for (Entry entry : archive.entries()) {
        Files.copy(archive.getInputStream(entry), outDir.resolve(entry.getName()));
    }

archive decompression

    InputStream compressed = Archives.getInputStream(Paths.get("foo/bar.tar.bz").toFile());
    Files.copy(compressed, Paths.get("foo/bar.tar"));

References

License

TODO