I'm trying to decompress a zip file with the API ZipFile from net.lingala.zip4j
public static void unzip(File zipf, File baseDir) throws IOException, ZipException {
String source = zipf.getAbsolutePath();//"some/compressed/file.zip";
String destination = baseDir.getPath();//"some/destination/folder";
// String password = "password";
try {
ZipFile zipFile = new ZipFile(source);
if (zipFile.isEncrypted()) {
// zipFile.setPassword(password);
}
zipFile.extractAll(destination);
} catch (ZipException e) {
e.printStackTrace();
}
}
I always got the error:
net.lingala.zip4j.exception.ZipException: Probably not a zip file or a corrupted zip file
May there is other solution to unZip the file.zip correctly?