lukehutch / quickunzip

Fast parallel unzipper written in Java
MIT License
12 stars 4 forks source link

java.util.zip.ZipException Invalid CEN header #3

Closed ccnasman closed 1 year ago

ccnasman commented 1 year ago

I get the following error when running quickunzip:

>  java io.github.lukehutch.quickunzip.QuickUnzip -o 'C:\Users\redacted\Desktop\zipfile.zip' 'C:\Users\redacted\Desktop\unzipped'
Could not read zipfile directory entries: java.util.zip.ZipException: invalid CEN header (bad entry name or comment)

Java version for reference:

> java --version
java 19.0.1 2022-10-18
Java(TM) SE Runtime Environment (build 19.0.1+10-21)
Java HotSpot(TM) 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
lukehutch commented 1 year ago

CEN is the central directory of the zipfile. It sounds like your zipfile is corrupt. Some unzip tools may still be able to unzip the file, depending on the extent of the corruption, but the Java standard libraries use a strict implementation of unzip.

This exception is thrown in the Java standard libraries based on the contents of the zipfile, so it's not a bug of the quickunzip library.