posted 20 years ago
The ZipFile class expects a physical file to look at, period. There are two basic workarounds:
Copy bytes from the entry's InputStream into a new temp file somewhere, then create a new ZipFile to read the file.Use ZipInputStream rather than ZipFile. ZipInputStream can read from any input stream, so you can use it on a physical file, or on another ZipInputStream. It's a bit more complicated to use than ZipFile, but not much.The tempfile approach will be slower, but if anything goes wrong it's probably easier to debug - you get a nice file as an intermediate step, which you can look at with some other tool like WinZip to see if it's what you're expecting. Even if you use the ZipInputStream approach, it may be useful for debugging to copy the contents for each ZipEntry to an intermediate file.
"I'm not back." - Bill Harding, Twister