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

Folder extraction does not work #348

Closed
Skyleiger opened this issue Aug 13, 2021 · 4 comments
Closed

Folder extraction does not work #348

Skyleiger opened this issue Aug 13, 2021 · 4 comments
Labels
bug Something isn't working resolved
Projects

Comments

@Skyleiger
Copy link

Skyleiger commented Aug 13, 2021

Hi,
I'd like to extract a folder from my zip file, but it doesn't work.
I got the following exception:

[2021-08-13 07:00:51.489         Console d.d.c.c.ConsoleSender                     INFO]:   net.lingala.zip4j.exception.ZipException: File header and local file header mismatch
[2021-08-13 07:00:51.489         Console d.d.c.c.ConsoleSender                     INFO]:       at net.lingala.zip4j.tasks.AbstractExtractFileTask.verifyNextEntry(AbstractExtractFileTask.java:151)
[2021-08-13 07:00:51.489         Console d.d.c.c.ConsoleSender                     INFO]:       at net.lingala.zip4j.tasks.AbstractExtractFileTask.extractFile(AbstractExtractFileTask.java:59)
[2021-08-13 07:00:51.490         Console d.d.c.c.ConsoleSender                     INFO]:       at net.lingala.zip4j.tasks.ExtractFileTask.executeTask(ExtractFileTask.java:43)
[2021-08-13 07:00:51.490         Console d.d.c.c.ConsoleSender                     INFO]:       at net.lingala.zip4j.tasks.ExtractFileTask.executeTask(ExtractFileTask.java:22)
[2021-08-13 07:00:51.490         Console d.d.c.c.ConsoleSender                     INFO]:       at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:51)
[2021-08-13 07:00:51.490         Console d.d.c.c.ConsoleSender                     INFO]:       at net.lingala.zip4j.tasks.AsyncZipTask.access$400(AsyncZipTask.java:9)
[2021-08-13 07:00:51.491         Console d.d.c.c.ConsoleSender                     INFO]:       at net.lingala.zip4j.tasks.AsyncZipTask$1.run(AsyncZipTask.java:36)
[2021-08-13 07:00:51.491         Console d.d.c.c.ConsoleSender                     INFO]:       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[2021-08-13 07:00:51.491         Console d.d.c.c.ConsoleSender                     INFO]:       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[2021-08-13 07:00:51.491         Console d.d.c.c.ConsoleSender                     INFO]:       at java.base/java.lang.Thread.run(Thread.java:829)

I use the following code to extract the folder:

ZipFile zipFile = new ZipFile(archive.toFile());
zipFile.setRunInThread(true);
zipFile.extractFile("data/", "/srv/test/");

Thank you for your help.
Dominic

@srikanth-lingala
Copy link
Owner

Which version of zip4j are you using?
If you are not on the latest version, please try with that to see if that helps.
If not, can you attach the zip file to this post?

@Skyleiger
Copy link
Author

I'm using the latest version: 2.9.0
I've attached the zip file.
05fb50b0-7be9-4d1c-b137-9bf3486a5465.zip

@srikanth-lingala
Copy link
Owner

Thanks for the zip file. I am able to reproduce the issue. Will look into this.

@srikanth-lingala srikanth-lingala added bug Something isn't working in-progress and removed want feedback labels Sep 10, 2021
@srikanth-lingala srikanth-lingala added this to To do in Zip4j via automation Sep 10, 2021
@srikanth-lingala srikanth-lingala moved this from To do to In progress in Zip4j Sep 10, 2021
srikanth-lingala added a commit that referenced this issue Sep 10, 2021
@srikanth-lingala srikanth-lingala moved this from In progress to Review in Zip4j Sep 10, 2021
@srikanth-lingala
Copy link
Owner

Fixed in v2.9.1 released today.

Zip4j automation moved this from Review to Done Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
Zip4j
  
Done
Development

No branches or pull requests

2 participants