[jsword-devel] Error unpacking zip which includes dir entries

Martin Denham mjdenham at gmail.com
Thu Sep 29 14:13:27 MST 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20110929/c452ed2c/attachment.html>


More information about the jsword-devel mailing list