B4J Question Error when unzipping Zip Files

potman100

Active Member
Licensed User
Longtime User
Hi

Wonder if anyone can help with a problem I am having with extracting Zip files, the zip file contains 1 file and when I run the following command

B4X:
Dim zip As ABZipUnzip

zip.ABUnzip(File.DirApp & "\tmp\" & "temp.zip",  File.DirApp & "\tmp\")

using ABZipUnzip library I get the following errors :

B4X:
java.lang.IllegalArgumentException: MALFORMED
    at java.util.zip.ZipCoder.toString(ZipCoder.java:58)
    at java.util.zip.ZipFile.getZipEntry(ZipFile.java:531)
    at java.util.zip.ZipFile.access$900(ZipFile.java:56)
    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:513)
    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:483)
    at com.AB.ABZipUnzip.ABZipUnzip.unzip(ABZipUnzip.java:130)
    at com.AB.ABZipUnzip.ABZipUnzip.ABUnzip(ABZipUnzip.java:113)
    at b4j.example.clsdownloader._cleandata(clsdownloader.java:369)
    at b4j.example.clsdownloader._astreams_newdata(clsdownloader.java:144)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:224)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
    at anywheresoftware.b4a.BA$3.run(BA.java:178)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
    at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
    at java.lang.Thread.run(Thread.java:744)

The zip file extracts fine in Winzip inder windows 7.

My java version is Version 7 Update 45 / jdk1.7.0_45

I have also attached the zip file I am trying to extract.

Thanks

Potman100
 

Attachments

  • temp.zip
    25.3 KB · Views: 271

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is this the actual content of this zip file:

SS-2014-07-20_04.37.25.png
?
 
Upvote 0

potman100

Active Member
Licensed User
Longtime User
Hi Erel

Yes that is correct, I believe that the file in the zip is created by an automated process.

Regards

Potman
 
Upvote 0

potman100

Active Member
Licensed User
Longtime User
Hi Billzhan

Thanks for the suggestion, but I had already tried the Archiver library before posting, it produces a similar error.

B4X:
java.io.IOException: java.lang.IllegalArgumentException: MALFORMED
    at flm.b4a.archiver.ArchiverForB4A.UnZip(ArchiverForB4A.java:734)
    at b4j.example.clsdownloader._cleandata(clsdownloader.java:365)
    at b4j.example.clsdownloader._astreams_newdata(clsdownloader.java:144)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:224)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
    at anywheresoftware.b4a.BA$3.run(BA.java:178)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
    at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
    at java.lang.Thread.run(Thread.java:744)

I think its more of a Java issue ?

Regards

Potman
 
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
Yes I can see the same thing here.

I think it's caused by the unusual file name.
When I the file name is same as before, exception thrown.
When I re name file to c.nzb and zip it, the archiver lib works
 
Upvote 0

potman100

Active Member
Licensed User
Longtime User
Yes, I had also noticed that, but the file name is legal as in terms of windows allowed file names.

The problem is as these files appear to be auto generated, they all are very similar to the one I have posted.

Looking on line this seems to be an issue with the Java 7 sdk / runtime.

Regards

Potman
 
Upvote 0
Top