#Extract a specific directory inside a ZipFile

4 messages · Page 1 of 1 (latest)

vast shuttle
#

Okay, so I've been banging my head on this one for a while, and I cannot figure out how to do this programmatically.

I have a ZipFile (Foo.zip) that has a directory inside of it (root/bar) with it's files (root/bar/fizz.file, root/bar/bang.file) that I want, but nothing else from the file. I know that I can unzip the entire file into a temporary directory, but I want to try to extract it without doing that.

I tried to get the ZipEntry of the directory I want, but I can't figure out how to get the files inside that entry out. I can't seem to get a working iterator either.

What am I missing?

trail mauveBOT
#

This post has been reserved for your question.

Hey @vast shuttle! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

umbral fulcrum
#

You have to inspect all ZipEntries and for each check whether it is in the desired directory. If so, extract it.