[jsword-svn] r2021 - trunk/jsword/src/main/java/org/crosswire/jsword/util
dmsmith at crosswire.org
dmsmith at crosswire.org
Wed Nov 24 20:31:42 MST 2010
Author: dmsmith
Date: 2010-11-24 20:31:42 -0700 (Wed, 24 Nov 2010)
New Revision: 2021
Modified:
trunk/jsword/src/main/java/org/crosswire/jsword/util/IndexDownloader.java
Log:
JS-130: Set status before and after doing download of index.
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/util/IndexDownloader.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/IndexDownloader.java 2010-11-24 23:53:02 UTC (rev 2020)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/IndexDownloader.java 2010-11-25 03:31:42 UTC (rev 2021)
@@ -31,6 +31,7 @@
import org.crosswire.jsword.book.install.Installer;
import org.crosswire.jsword.index.IndexManager;
import org.crosswire.jsword.index.IndexManagerFactory;
+import org.crosswire.jsword.index.IndexStatus;
/**
* .
@@ -56,14 +57,18 @@
// Get a temp home
URI tempDownload = NetUtil.getTemporaryURI(TEMP_PREFIX, TEMP_SUFFIX);
+ IndexStatus finalStatus = IndexStatus.UNDONE;
try {
// Now we know what installer to use, download to the temp file
installer.downloadSearchIndex(book, tempDownload);
// And install from that file.
IndexManager idxman = IndexManagerFactory.getIndexManager();
+ book.setIndexStatus(IndexStatus.CREATING);
idxman.installDownloadedIndex(book, tempDownload);
+ finalStatus = IndexStatus.DONE;
} finally {
+ book.setIndexStatus(finalStatus);
// tidy up after ourselves
if (tempDownload != null) {
NetUtil.delete(tempDownload);
More information about the jsword-svn
mailing list