ZipInputStream sometimes behaves as expected sometimes not
posted 8 years ago
I want to get InputStream-objects (to be passed to another class) from a zip-file, which consists of xml-files. The problem is that sometimes I can get it correctly, but sometimes I got FileNotFoundException. It seems to depend on the zip-file, maybe those are extracted into temp, or something behind the scenes..
You're using FileInputStream, which looks for files in your file system. For ZIP entries you should use the ZipInputStream itself. Every time you call getNextEntry, this will reposition itself to the new file.