[jsword-devel] Error unpacking zip which includes dir entries
DM Smith
dmsmith at crosswire.org
Thu Sep 29 16:09:20 MST 2011
I think that it is a shortcoming of the code. We developed the code based upon the CrossWire modules. At that time there was no other repository.
Put in a Jira report so we don't forget.
Cent from my fone so theer mite be tipos. ;)
On Sep 29, 2011, at 5:13 PM, Martin Denham <mjdenham at gmail.com> wrote:
> I have discovered that module unzipping is a little fussy about the zips. The current JSword code does not cope with directory entries in the zip file.
>
> Some times when I zip up a module the zip includes directory entries which make the zip unpacking fail (at least on Android) with the following stack trace:
>
> 09-29 21:53:11.555: INFO/System.out(29460): *** uri:file:/mnt/sdcard/Android/data/net.bible.android.activity/files/modules/
> 09-29 21:53:11.565: WARN/System.err(29460): java.io.FileNotFoundException: /mnt/sdcard/Android/data/net.bible.android.activity/files/modules (Is a directory)
> 09-29 21:53:11.565: WARN/System.err(29460): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
> 09-29 21:53:11.565: WARN/System.err(29460): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
> 09-29 21:53:11.565: WARN/System.err(29460): at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
> 09-29 21:53:11.565: WARN/System.err(29460): at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
> 09-29 21:53:11.565: WARN/System.err(29460): at org.crosswire.common.util.NetUtil.getOutputStream(NetUtil.java:455)
> 09-29 21:53:11.565: WARN/System.err(29460): at org.crosswire.common.util.NetUtil.getOutputStream(NetUtil.java:435)
> 09-29 21:53:11.565: WARN/System.err(29460): at org.crosswire.common.util.IOUtil.unpackZip(IOUtil.java:84)
> 09-29 21:53:11.565: WARN/System.err(29460): at org.crosswire.jsword.book.install.sword.AbstractSwordInstaller$1.run(AbstractSwordInstaller.java:258)
>
> I wonder if others have experienced this.
>
> I recall having a lot of problems with some of the zips from the Xiphos repo, but no problems with zips on the CrossWire repo and I wonder if this could be the cause.
>
> I have created an ant task to generate the module zip and noticed that I needed the 'filesonly="true"' flag on the zip task without which unzipping failed.
> <zip destfile="${distribution.dir}/${module.zipfile}" filesonly="true">
>
> I wondered if anybody else had encountered this before.
>
> Martin
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
More information about the jsword-devel
mailing list