[jsword-svn]
jsword/java/limbo/org/crosswire/jsword/book/search/ser s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Fri Oct 15 16:28:09 MST 2004
Update of /cvs/jsword/jsword/java/limbo/org/crosswire/jsword/book/search/ser
In directory www.crosswire.org:/tmp/cvs-serv30320/java/limbo/org/crosswire/jsword/book/search/ser
Modified Files:
SerIndexManager.java
Log Message:
progress on downloading index
Index: SerIndexManager.java
===================================================================
RCS file: /cvs/jsword/jsword/java/limbo/org/crosswire/jsword/book/search/ser/SerIndexManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SerIndexManager.java 10 Oct 2004 22:12:02 -0000 1.2
--- SerIndexManager.java 15 Oct 2004 23:28:07 -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.search.Index;
import org.crosswire.jsword.book.search.IndexManager;
***************
*** 50,54 ****
try
{
! URL storage = getStorageArea(book);
URL longer = NetUtil.lengthenURL(storage, SerIndex.FILE_INDEX);
return NetUtil.isFile(longer);
--- 51,55 ----
try
{
! URL storage = getStorageArea(book.getBookMetaData());
URL longer = NetUtil.lengthenURL(storage, SerIndex.FILE_INDEX);
return NetUtil.isFile(longer);
***************
*** 71,75 ****
if (reply == null)
{
! URL storage = getStorageArea(book);
reply = new SerIndex(book, storage);
indexes.put(book, reply);
--- 72,76 ----
if (reply == null)
{
! URL storage = getStorageArea(book.getBookMetaData());
reply = new SerIndex(book, storage);
indexes.put(book, reply);
***************
*** 95,99 ****
try
{
! URL storage = getStorageArea(book);
Index index = new SerIndex(book, storage, true);
indexes.put(book, index);
--- 96,100 ----
try
{
! URL storage = getStorageArea(book.getBookMetaData());
Index index = new SerIndex(book, storage, true);
indexes.put(book, index);
***************
*** 111,120 ****
* @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);
}
--- 112,121 ----
* @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);
}
***************
*** 133,137 ****
{
// TODO(joe): This needs some checks that it isn't being used
! URL storage = getStorageArea(book);
NetUtil.delete(storage);
}
--- 134,138 ----
{
// TODO(joe): This needs some checks that it isn't being used
! URL storage = getStorageArea(book.getBookMetaData());
NetUtil.delete(storage);
}
***************
*** 144,155 ****
/**
* 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;
--- 145,156 ----
/**
* 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