Friday, 15 March 2013

java.util.zip.ZipError: invalid CEN header (bad signature) -



java.util.zip.ZipError: invalid CEN header (bad signature) -

i'm using java 1.7.0_40 on reddish hat linux , have next code:

path zipfile = paths.get(filename); filesystem fs = filesystems.newfilesystem(zipfile, filetest.class.getclassloader());

the filename variable points zip file 788mb. uncompressed size of zip file 8.3gb. when run code above next exception:

exception in thread "main" java.util.zip.ziperror: invalid cen header (bad signature) @ com.sun.nio.zipfs.zipfilesystem.zerror(zipfilesystem.java:1605) @ com.sun.nio.zipfs.zipfilesystem.initcen(zipfilesystem.java:1058) @ com.sun.nio.zipfs.zipfilesystem.<init>(zipfilesystem.java:130) @ com.sun.nio.zipfs.zipfilesystemprovider.newfilesystem(zipfilesystemprovider.java:139) @ java.nio.file.filesystems.newfilesystem(filesystems.java:386) @ filetest.readfromzip(filetest.java:35) @ filetest.main(filetest.java:25)

i under impression java 7 capable of handling big zip files. can explain why happening?

thanks.

i faced issue in maven based project. issue occurred because of corrupted jars. deleted jars .m2 folder , built project again; , worked charm.

java zip nio

No comments:

Post a Comment