[jsword-devel] Upgrade module - delete then install problem

Martin Denham mjdenham at gmail.com
Thu Feb 20 15:43:34 MST 2014


I have been analyzing occasional And Bible module upgrade problems today.
 DM - you observed this while attempting to upgrade KJV recently.

Upgrade consists of:
1. delete installed module (book.getDriver().delete(book);)
2. install new module

However about half the time an error occurs on step 2 in IOUtil.unpackZip
on the following line:
     if (!parentDir.mkdirs()) {
This error never occurs when installing a new module so it is related to
removal of the previous version of the module.

I can't really work out why that call sometimes fails during module upgrade
and the only idea I have come up with is "Java is known not to delete files
immediately, so mkdir may fail sometimes" (
http://stackoverflow.com/questions/617414/create-a-temporary-directory-in-java).
 What do you think of that reason?  I have never knowingly observed this
delay in deletion and the above is the only mention I have seen of this
problem.

I have a sort-of work around for the above problem which is
1. remove module from JSword lists without deleting files
(Books.installed().removeBook(book);)
2. install new module (overwriting previous files)
Do module file names ever change in later versions?  Are there any other
potential problems?

There also seems to be a minor bug in Books.removeBook() which has;
     names.put(book.getName(), book);
which I believe should be:
     names.remove(book.getName());
but this does not appear to cause any problems.

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140220/358260a3/attachment.html>


More information about the jsword-devel mailing list