I have zipped a folder containing files and folders using zip4j in Java. I want to validate created zip for -
- The number of files chosen before zipped?
- Whether files are not being corrupted during zip process?
Thanks
I have zipped a folder containing files and folders using zip4j in Java. I want to validate created zip for -
Thanks
Please read through this snippet . http://www.java-examples.com/get-crc-32-checksum-zip-entry-example
You can catch the execption for the invalid checking of the file.
Look at the following snippet
You can use this code and insert a static counter to count the files inside the zip. Coupling this code to your zipping logic should work just fine.
What I'd do is extract the folder to a different location, use the standard POSIX
find
andcmp
commands to compare the corresponding files in the original and extracted directories.