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

extracting subdirectory requires directory entries in the zip #347

Closed
peteruhnak opened this issue Aug 12, 2021 · 2 comments
Closed

extracting subdirectory requires directory entries in the zip #347

peteruhnak opened this issue Aug 12, 2021 · 2 comments
Assignees
Labels
bug Something isn't working resolved
Projects

Comments

@peteruhnak
Copy link

According to the docs, it should be possible to extract subdirectories, e.g.

new ZipFile("filename.zip").extractFile("folderNameInZip/", "/destination_directory");

However, this requires a directory entry to be present in the archive:

As far as I understand, having directory entries in zips is optional, so the unzipping should not check for them. Presumably it should only compare against the user-supplied entry name (and ensure the user-supplied name ends with a slash).

Here's an example archive with no directory entires:

archive-no-dirs.zip

The archive was created with Powershell 7 Compress-Archive cmdlet ( https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive?view=powershell-7.1 )

@srikanth-lingala
Copy link
Owner

Yes, you are right. It should be possible to extract subdirectories without the subdirectory entry being present. I will fix this.

@srikanth-lingala srikanth-lingala self-assigned this Sep 10, 2021
@srikanth-lingala srikanth-lingala added bug Something isn't working in-progress 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 srikanth-lingala moved this from In progress to Review in Zip4j Sep 11, 2021
srikanth-lingala added a commit that referenced this issue Sep 11, 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