// Initiate ZipFile object with the path/name of the zip file.
ZipFile zipFile = new ZipFile("c:\\ZipTest\\CreateSplitZipFileFromFolder.zip");
// Initiate Zip Parameters which define various properties such
// as compression method, etc.
ZipParameters parameters = new ZipParameters();
// set compression method to store compression
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
// Set the compression level. This value has to be in between 0 to 9
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
// Create a split file by setting splitArchive parameter to true
// and specifying the splitLength. SplitLenth has to be greater than
// 65536 bytes
// Please note: If the zip file already exists, then this method throws an
// exception
zipFile.createZipFileFromFolder("C:\\ZipTest", parameters, true, 10485760);
I copied this from the sample code for using zip4j, specifically the file named CreateSplitZipFileFromFolder.java
the problem is that, even if I set to true the third parameter of createZipFileFromFolder
, it would still return false when I call the method ZipFile.isSplitArchive()
from grepcode, it appears it just sets the ZipModel
object the boolean flag that I set, but I get a different value. any ideas why this is?