Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ArchiveOutputStream
✓ org.apache.commons.compress.archivers.ArchiveOutputStream
Create a zip archive with a single entry
import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import java.io.FileOutputStream;
public class Main {
public static void main(String[] args) throws Exception {
try (ArchiveOutputStream out = new ZipArchiveOutputStream(new FileOutputStream("output.zip"))) {
ArchiveEntry entry = out.createArchiveEntry(new File("input.txt"), "input.txt");
out.putArchiveEntry(entry);
out.write("Hello".getBytes());
out.closeArchiveEntry();
}
}
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.