I have used net.lingala.zip4j:zip4j:2.11.2 gradle dependency in android project to create a zip file. The created Zip file will contain a folder, folder with in the main folder. The final folder will contain a TXT file.
Zip file instance created using below approach.
new ZipFile(mFileName,password.toCharArray());
Once I copied the logs, Observed 0 KB zip file created. When I try to extract the 0 KB ZIP file. It is giving error "The archive is either in unknown format or damaged"
I have used below code to create the ZIP file from files.
The issue is not always. It is observed randomly.
ZipParameters zipParameters = new ZipParameters();
zipParameters.setEncryptFiles(true);
zipParameters.setEncryptionMethod(EncryptionMethod.ZIP_STANDARD);
ZipFile zipFile = null;
try {
zipFile = new ZipFile(mFileName,password.toCharArray());
zipFile.addFiles(filesToAdd,zipParameters);
}
Hi,
I have used net.lingala.zip4j:zip4j:2.11.2 gradle dependency in android project to create a zip file. The created Zip file will contain a folder, folder with in the main folder. The final folder will contain a TXT file.
Zip file instance created using below approach.
new ZipFile(mFileName,password.toCharArray());
Once I copied the logs, Observed 0 KB zip file created. When I try to extract the 0 KB ZIP file. It is giving error "The archive is either in unknown format or damaged"
I have used below code to create the ZIP file from files.
The issue is not always. It is observed randomly.
ZipParameters zipParameters = new ZipParameters(); zipParameters.setEncryptFiles(true); zipParameters.setEncryptionMethod(EncryptionMethod.ZIP_STANDARD); ZipFile zipFile = null; try { zipFile = new ZipFile(mFileName,password.toCharArray()); zipFile.addFiles(filesToAdd,zipParameters); }
Thanks IN advance for your answer.