how to zip a folder itself using java

Have you tried Zeroturnaround Zip library? It’s really neat! Zip a folder is just a one liner:

ZipUtil.pack(new File("D:\\reports\\january\\"), new File("D:\\reports\\january.zip"));

(thanks to Oleg Ĺ elajev for the example)

Leave a Comment