zip4j
zip4j copied to clipboard
exception Zip4j is in busy state
I appreciate the open source code you provided I like it very much.the problem i'm having. Zip all files in the current folder throw exception net.lingala.zip4j.exception.ZipException: invalid operation - Zip4j is in busy state. Below is the code I wrote I don't know where is the problem
private void forEachDirectory(File currentFile, ZipFile zipFile) throws ZipException {
File[] listFiles = currentFile.listFiles();
if (listFiles != null) {
for (File file : listFiles) {
if (file.isDirectory()) {
zipFile.addFolder(file);
forEachDirectory(file, zipFile);
} else {
zipFile.addFile(file);
}
}
}
}