Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When i use the zipFile.createSplitZipFile(files, zipParameters, true, 1024 * 70) this line actually split the original zip file into multiple based on size i.e. 70kb.But the content inside the all zip files are same.the content is not splitting up. could you please resolve this issue? or is there any other way call the function? #451

Closed
srikanthvadde opened this issue Jul 14, 2022 · 4 comments

Comments

@srikanthvadde
Copy link

@srikanthvadde This issue is unrelated to the one this thread is about. Please open a new issue with the problem you are facing, and include as many details as possible like zip4j version, your complete code snippet, os and version, and anything else that you think might be useful. BTW, if you are already not on the latest version of zip4j, try with the latest version before opening this issue.

Originally posted by @srikanth-lingala in #120 (comment)

@srikanthvadde srikanthvadde changed the title @srikanthvadde This issue is unrelated to the one this thread is about. Please open a new issue with the problem you are facing, and include as many details as possible like zip4j version, your complete code snippet, os and version, and anything else that you think might be useful. BTW, if you are already not on the latest version of zip4j, try with the latest version before opening this issue. When i use the zipFile.createSplitZipFile(files, zipParameters, true, 1024 * 70) this line actually split the original zip file into multiple based on size i.e. 70kb.But the content inside the all zip files are same.the content is not splitting up. could you please resolve this issue? or is there any other way call the function? Jul 14, 2022
@srikanthvadde
Copy link
Author

srikanthvadde commented Jul 14, 2022

issue: When i use the zipFile.createSplitZipFile(files, zipParameters, true, 1024 * 70) this line actually split the original zip file into multiple based on size i.e. 70kb.But the content inside the all zip files are same.the content is not splitting up. could you please resolve this issue? or is there any other way call the function?

os: windows(10.0.19904)
version: latest from maven (2.11.x)
pl: java
framework: camel (3.x),spring boot latest (2.5.x)

sample code:
       ```
ZipParameters zipParameters = new ZipParameters();
        zipParameters.setEncryptFiles(true);
        zipParameters.setEncryptionMethod(EncryptionMethod.AES);
        ZipFile zipFile = new ZipFile("compressed.zip","password".toCharArray());
        List<File> files = new ArrayList<>();

        // int splitLength = 1024*70; //70kb

        for (data) {
          //create the csv file with data using apache common csv library
         // add the csv file to files like below
           files.add(file)//csv files 
        }

        zipFile.createSplitZipFile(files, zipParameters, true, 1024 * 70);

@srikanth-lingala
Copy link
Owner

How do you know that the content inside all the split zip files is the same? The content length will be the same because of the split length. What happens when you try to extract the zip file?

@srikanthvadde
Copy link
Author

srikanthvadde commented Jul 14, 2022

Hi
I am actually using sample data of 100k records to create the each csv file. Hence when i check each zip file contents all files have same no of records with same size but the zip file is splitting up and size reduces.

Attaching some screenshots for reference: please go through on order wise.
s-1
s-2
s-3
s-4
s-5

@srikanth-lingala
Copy link
Owner

I believe your understanding of a split zip file is different than the way it is actually supposed to work. Each part of a split zip file is NOT a zip file by itself. Each part is just that, a part of the complete zip file. You cannot just extract one part of a split zip file. When you extract a split zip file, you are extracting content from all the split zip files. In your case, the csv files that you see are the entries in both compressed.zip and compressed.z01. Hope this makes it clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants