[jsword-svn]
jsword/java/jsword/org/crosswire/jsword/book/search/lucene s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Fri Oct 15 16:28:10 MST 2004
Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene
In directory www.crosswire.org:/tmp/cvs-serv30320/java/jsword/org/crosswire/jsword/book/search/lucene
Modified Files:
LuceneIndexManager.java
Log Message:
progress on downloading index
Index: LuceneIndexManager.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/LuceneIndexManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LuceneIndexManager.java 10 Oct 2004 22:12:02 -0000 1.2
--- LuceneIndexManager.java 15 Oct 2004 23:28:08 -0000 1.3
***************
*** 13,16 ****
--- 13,17 ----
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookException;
+ import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.IndexStatus;
import org.crosswire.jsword.book.search.Index;
***************
*** 51,55 ****
try
{
! URL storage = getStorageArea(book);
URL longer = NetUtil.lengthenURL(storage, DIR_SEGMENTS);
return NetUtil.isFile(longer);
--- 52,56 ----
try
{
! URL storage = getStorageArea(book.getBookMetaData());
URL longer = NetUtil.lengthenURL(storage, DIR_SEGMENTS);
return NetUtil.isFile(longer);
***************
*** 72,76 ****
if (reply == null)
{
! URL storage = getStorageArea(book);
reply = new LuceneIndex(book, storage);
indexes.put(book, reply);
--- 73,77 ----
if (reply == null)
{
! URL storage = getStorageArea(book.getBookMetaData());
reply = new LuceneIndex(book, storage);
indexes.put(book, reply);
***************
*** 98,102 ****
try
{
! URL storage = getStorageArea(book);
Index index = new LuceneIndex(book, storage, true);
indexes.put(book, index);
--- 99,103 ----
try
{
! URL storage = getStorageArea(book.getBookMetaData());
Index index = new LuceneIndex(book, storage, true);
indexes.put(book, index);
***************
*** 114,123 ****
* @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);
}
--- 115,124 ----
* @see org.crosswire.jsword.book.search.IndexManager#installDownloadedIndex(org.crosswire.jsword.book.Book, java.net.URL)
*/
! public void installDownloadedIndex(BookMetaData bmd, URL tempDest) throws BookException
{
try
{
! URL storage = getStorageArea(bmd);
! File zip = NetUtil.getAsFile(tempDest);
IOUtil.unpackZip(zip, storage);
}
***************
*** 136,140 ****
{
// TODO(joe): This needs some checks that it isn't being used
! URL storage = getStorageArea(book);
NetUtil.delete(storage);
}
--- 137,141 ----
{
// TODO(joe): This needs some checks that it isn't being used
! URL storage = getStorageArea(book.getBookMetaData());
NetUtil.delete(storage);
}
***************
*** 147,158 ****
/**
* Determine where an index should be stored
! * @param book The book to be indexed
* @return A URL to store stuff in
* @throws IOException If there is a problem in finding where to store stuff
*/
! protected URL getStorageArea(Book book) throws IOException
{
! String driverName = book.getBookMetaData().getDriverName();
! String bookName = book.getBookMetaData().getInitials();
assert driverName != null;
--- 148,159 ----
/**
* Determine where an index should be stored
! * @param bmd The book to be indexed
* @return A URL to store stuff in
* @throws IOException If there is a problem in finding where to store stuff
*/
! protected URL getStorageArea(BookMetaData bmd) throws IOException
{
! String driverName = bmd.getDriverName();
! String bookName = bmd.getInitials();
assert driverName != null;
More information about the jsword-svn
mailing list