I want to open a ZIP-file, that have no entries with java.util.zip.ZipFile. But on the constructor I get the following exception: 'java.util.zip.ZipException: error in opening zip file'. How can I open the empty ZIP?
That ZIP-file is created by the commandline zip-program under linux. I simply deleted all entries from a ZIP-file.
I need this as testdata for a class I write. The class should simply return an empty list for this case, but broken ZIP-files should return an error.
For some more explanation on the problem. I have an interface, for extracting some documents from different sources. Other implementations gather them from webservices or directories, this implementation from ZIP-files. The interface give an Iterator with some more functionality. So I want to decide, if the ZIP-file is empty or broken.