1

I have successfully zip or unzip file by using Apache Common Compress library. Now the problem is, the compressed file needs to be send via FTP/email and 10 MB is the maximum limit of the file to be sent.

  1. So I need know the way to generate file(s) with custom size?
  2. How can I uncompress the file(s)?

Thanks.

Aditya Sharma
  • 645
  • 1
  • 10
  • 28

2 Answers2

0

Must you use Apache Common Compress? Otherwise this answer might be interesting for you: how to create java zip archives with a max file size limit

Community
  • 1
  • 1
uniknow
  • 938
  • 6
  • 5
0

According to their official user guide for zip under "Multi Volume Archives" :

If you want to create a split ZIP archive you use the constructor of ZipArchiveOutputStream that accepts a File argument and a size. The size determines the maximum size of a split segment - the size must be between 64kB and 4GB. While creating the archive, this will create several files fillowing the naming convention described above. The name of the File argument used inside of the constructor must use the extension zip.

source: https://commons.apache.org/proper/commons-compress/zip.html

Mahmoud
  • 9,729
  • 1
  • 36
  • 47