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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Fri Mar 18 18:56:49 MST 2005


Update of /cvs/jsword/jsword/java/limbo/org/crosswire/jsword/book/search/ser
In directory www.crosswire.org:/tmp/cvs-serv10359/java/limbo/org/crosswire/jsword/book/search/ser

Modified Files:
	SerIndexManager.java 
Log Message:
Made Book the primary interface to a module and put BookMetaData within it. All of BookMetaData is accessible through the Book interface.

Index: SerIndexManager.java
===================================================================
RCS file: /cvs/jsword/jsword/java/limbo/org/crosswire/jsword/book/search/ser/SerIndexManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SerIndexManager.java	26 Jan 2005 00:57:33 -0000	1.4
--- SerIndexManager.java	19 Mar 2005 01:56:47 -0000	1.5
***************
*** 51,55 ****
          try
          {
!             URL storage = getStorageArea(book.getBookMetaData());
              URL longer = NetUtil.lengthenURL(storage, SerIndex.FILE_INDEX);
              return NetUtil.isFile(longer);
--- 51,55 ----
          try
          {
!             URL storage = getStorageArea(book);
              URL longer = NetUtil.lengthenURL(storage, SerIndex.FILE_INDEX);
              return NetUtil.isFile(longer);
***************
*** 72,76 ****
              if (reply == null)
              {
!                 URL storage = getStorageArea(book.getBookMetaData());
                  reply = new SerIndex(book, storage);
                  indexes.put(book, reply);
--- 72,76 ----
              if (reply == null)
              {
!                 URL storage = getStorageArea(book);
                  reply = new SerIndex(book, storage);
                  indexes.put(book, reply);
***************
*** 96,100 ****
                  try
                  {
!                     URL storage = getStorageArea(book.getBookMetaData());
                      Index index = new SerIndex(book, storage, true);
                      indexes.put(book, index);
--- 96,100 ----
                  try
                  {
!                     URL storage = getStorageArea(book);
                      Index index = new SerIndex(book, storage, true);
                      indexes.put(book, index);
***************
*** 112,120 ****
       * @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, NetUtil.getAsFile(storage));
--- 112,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(tempDest);
              IOUtil.unpackZip(zip, NetUtil.getAsFile(storage));
***************
*** 134,138 ****
          {
              // TODO(joe): This needs some checks that it isn't being used
!             URL storage = getStorageArea(book.getBookMetaData());
              NetUtil.delete(storage);
          }
--- 134,138 ----
          {
              // TODO(joe): This needs some checks that it isn't being used
!             URL storage = getStorageArea(book);
              NetUtil.delete(storage);
          }
***************
*** 145,154 ****
      /**
       * 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();
--- 145,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
      {
+         BookMetaData bmd = book.getBookMetaData();
          String driverName = bmd.getDriverName();
          String bookName = bmd.getInitials();



More information about the jsword-svn mailing list