I have a ZIP file (actually EPUB ebook, which is the same as ZIP), and when I try to open it with a line like:
ZipFile zf = new ZipFile("/path/filename.epub");
I get "java.util.zip.ZipException: invalid CEN header (duplicate entry)" in java.util.zip.ZipFile.open(Native Method), and cannot read this file. Other ZIP utilities, e.g. command line unzip, WinRar, other ebook readers - read this file fine. Is there anyway to ignore this exception and still open a valid ZipFile?
Note: try/catch is not helpful here, as it does not allow me to read this file. The only possibility I see is to open this file with my own native code, re-compress it avoiding the (benign, not fatal) duplicate entry in the header, save as a temp file and return to Java to read this temp file instead. I hope for a better solution...