[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/search/lucene s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sun Oct 10 15:12:04 MST 2004


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene
In directory www.crosswire.org:/tmp/cvs-serv25203/java/jsword/org/crosswire/jsword/book/search/lucene

Modified Files:
	Msg.properties Msg.java LuceneIndexManager.java 
Log Message:
basics of downloadable indexers

Index: Msg.properties
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/Msg.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Msg.properties	9 Oct 2004 21:45:05 -0000	1.3
--- Msg.properties	10 Oct 2004 22:12:02 -0000	1.4
***************
*** 14,15 ****
--- 14,16 ----
  LuceneIndex.Optimizing=Optimizing
  LuceneIndex.DeleteFailed=Failed to delete search index
+ LuceneIndex.InstallFailed=Installation failed

Index: LuceneIndexManager.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/LuceneIndexManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LuceneIndexManager.java	9 Oct 2004 21:45:05 -0000	1.1
--- LuceneIndexManager.java	10 Oct 2004 22:12:02 -0000	1.2
***************
*** 1,4 ****
--- 1,5 ----
  package org.crosswire.jsword.book.search.lucene;
  
+ import java.io.File;
  import java.io.IOException;
  import java.net.URL;
***************
*** 6,9 ****
--- 7,11 ----
  import java.util.Map;
  
+ import org.crosswire.common.util.IOUtil;
  import org.crosswire.common.util.Logger;
  import org.crosswire.common.util.NetUtil;
***************
*** 17,21 ****
  
  /**
!  * .
   * 
   * <p><table border='1' cellPadding='3' cellSpacing='0'>
--- 19,23 ----
  
  /**
!  * An implementation of IndexManager for Lucene indexes.
   * 
   * <p><table border='1' cellPadding='3' cellSpacing='0'>
***************
*** 110,113 ****
--- 112,132 ----
  
      /* (non-Javadoc)
+      * @see org.crosswire.jsword.book.search.IndexManager#installDownloadedIndex(org.crosswire.jsword.book.Book, java.net.URL)
+      */
+     public void installDownloadedIndex(Book book, URL tempDest) throws BookException
+     {
+         try
+         {
+             URL storage = getStorageArea(book);
+             File zip = NetUtil.getAsFile(storage);
+             IOUtil.unpackZip(zip, storage);
+         }
+         catch (IOException ex)
+         {
+             throw new BookException(Msg.INSTALL_FAIL, ex);
+         }
+     }
+ 
+     /* (non-Javadoc)
       * @see org.crosswire.jsword.book.search.IndexManager#deleteIndex(org.crosswire.jsword.book.Book)
       */

Index: Msg.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/Msg.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Msg.java	9 Oct 2004 21:45:05 -0000	1.10
--- Msg.java	10 Oct 2004 22:12:02 -0000	1.11
***************
*** 37,40 ****
--- 37,41 ----
      static final Msg OPTIMIZING = new Msg("LuceneIndex.Optimizing"); //$NON-NLS-1$
      static final Msg DELETE_FAILED = new Msg("LuceneIndex.DeleteFailed"); //$NON-NLS-1$
+     static final Msg INSTALL_FAIL = new Msg("LuceneIndex.InstallFailed"); //$NON-NLS-1$
  
      /**



More information about the jsword-svn mailing list