0

I'm packing ZIP files using Zip4j. Sometimes, the created ZIP file seems to be (uploaded) corrupted via FTP so I would like to validate it.

The code snippets from here don't work because they cause an exception on password protected archives by default since the default Java ZipFile doesn't support password protections.

BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185

1 Answers1

1

How about the usual hash validation?

  1. Create your ZIP
  2. Calculate its md5 (DigestUtils from commons-digest may be used)
  3. Upload the ZIP
  4. Upload the hash in a text file
  5. On the receiving side, rehash it with md5 and compare with the received MD5
Roman Puchkovskiy
  • 11,415
  • 5
  • 36
  • 72