[jsword-svn] r1363 - in trunk/jsword/src/main/java/org/crosswire/jsword: book book/basic book/install/sword book/readings index index/lucene util
dmsmith at www.crosswire.org
dmsmith at www.crosswire.org
Fri Jun 1 04:13:08 MST 2007
Author: dmsmith
Date: 2007-06-01 04:13:08 -0700 (Fri, 01 Jun 2007)
New Revision: 1363
Modified:
trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/HttpSwordInstaller.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBookDriver.java
trunk/jsword/src/main/java/org/crosswire/jsword/index/IndexManager.java
trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndexManager.java
trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java
Log:
Fixed a URI bug.
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookMetaData.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -267,12 +267,12 @@
/**
* The key for the URI locating where this book is installed
*/
- String KEY_LIBRARY_URL = "LibraryURL"; //$NON-NLS-1$
+ String KEY_LIBRARY_URI = "LibraryURI"; //$NON-NLS-1$
/**
* The key for the URI locating this book
*/
- String KEY_LOCATION_URL = "LocationURL"; //$NON-NLS-1$
+ String KEY_LOCATION_URI = "LocationURI"; //$NON-NLS-1$
/**
* The key for the indexed status in the properties map
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -389,10 +389,6 @@
*/
protected void autoRegister()
{
- // URL predicturl =
- // Project.instance().getWritablePropertiesURL("books"); //$NON-NLS-1$
- // Progress job = JobManager.createJob(Msg.JOB_TITLE.toString(), predicturl, null, true);
-
// This will classload them all and they will register themselves.
Class[] types = ClassUtil.getImplementors(BookDriver.class);
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -143,7 +143,7 @@
URI uri = null;
try
{
- String loc = getProperty(KEY_LIBRARY_URL);
+ String loc = getProperty(KEY_LIBRARY_URI);
if (loc != null)
{
uri = new URI(loc);
@@ -161,7 +161,7 @@
*/
public void setLibrary(URI library)
{
- putProperty(KEY_LIBRARY_URL, library.toString());
+ putProperty(KEY_LIBRARY_URI, library.toString());
}
/* (non-Javadoc)
@@ -169,7 +169,7 @@
*/
public void setLocation(URI location)
{
- putProperty(KEY_LOCATION_URL, location.toString());
+ putProperty(KEY_LOCATION_URI, location.toString());
}
/* (non-Javadoc)
@@ -180,7 +180,7 @@
URI uri = null;
try
{
- String loc = getProperty(KEY_LOCATION_URL);
+ String loc = getProperty(KEY_LOCATION_URI);
if (loc != null)
{
uri = new URI(loc);
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -77,7 +77,7 @@
protected abstract void download(Progress job, String dir, String file, URI dest) throws InstallException;
/* (non-Javadoc)
- * @see org.crosswire.jsword.book.install.Installer#getURL()
+ * @see org.crosswire.jsword.book.install.Installer#getInstallerDefinition()
*/
public String getInstallerDefinition()
{
@@ -118,21 +118,11 @@
return false;
}
- URI configurl = null;
- try
- {
- configurl = new URI(NetUtil.PROTOCOL_FILE, null, conf.getAbsolutePath(), null);
+ URI configURI = NetUtil.getURI(conf);
+
- }
- catch (URISyntaxException ex)
- {
- log.error("Failed to create URL for file: " + conf, ex); //$NON-NLS-1$
- assert false;
- return false;
- }
-
URI remote = toRemoteURI(book);
- return NetUtil.isNewer(remote, configurl, proxyHost, proxyPort);
+ return NetUtil.isNewer(remote, configURI, proxyHost, proxyPort);
}
/* (non-Javadoc)
@@ -184,8 +174,8 @@
/* @Override */
public void run()
{
- URI predicturl = Project.instance().getWritablePropertiesURI("sword-install"); //$NON-NLS-1$
- Progress job = JobManager.createJob(Msg.INSTALLING.toString(sbmd.getName()), predicturl, this, true);
+ URI predictURI = Project.instance().getWritablePropertiesURI("sword-install"); //$NON-NLS-1$
+ Progress job = JobManager.createJob(Msg.INSTALLING.toString(sbmd.getName()), predictURI, this, true);
yield();
@@ -261,7 +251,7 @@
}
/* (non-Javadoc)
- * @see org.crosswire.jsword.book.install.Installer#downloadSearchIndex(org.crosswire.jsword.book.BookMetaData, java.net.URL)
+ * @see org.crosswire.jsword.book.install.Installer#downloadSearchIndex(org.crosswire.jsword.book.BookMetaData, java.net.URI)
*/
public void downloadSearchIndex(Book book, URI localDest) throws InstallException
{
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/HttpSwordInstaller.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/HttpSwordInstaller.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/HttpSwordInstaller.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -59,7 +59,7 @@
}
/* (non-Javadoc)
- * @see org.crosswire.jsword.book.install.Installer#toRemoteURL(org.crosswire.jsword.book.BookMetaData)
+ * @see org.crosswire.jsword.book.install.Installer#toRemoteURI(org.crosswire.jsword.book.Book)
*/
public URI toRemoteURI(Book book)
{
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBookDriver.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBookDriver.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBookDriver.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -28,7 +28,7 @@
import org.crosswire.common.util.NetUtil;
import org.crosswire.common.util.ResourceUtil;
-import org.crosswire.common.util.URLFilter;
+import org.crosswire.common.util.URIFilter;
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookCategory;
import org.crosswire.jsword.book.BookDriver;
@@ -93,7 +93,7 @@
try
{
URL index = ResourceUtil.getResource(ReadingsBookDriver.class, "readings.txt"); //$NON-NLS-1$
- return NetUtil.listByIndexFile(NetUtil.toURI(index), new URLFilter()
+ return NetUtil.listByIndexFile(NetUtil.toURI(index), new URIFilter()
{
public boolean accept(String name)
{
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/IndexManager.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/IndexManager.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/IndexManager.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -56,7 +56,7 @@
* We have downloaded a search index to a zip file. It should be installed
* from here.
* @param book The book that we downloaded an index for
- * @param tempDest The URL of a zip file to install
+ * @param tempDest The URI of a zip file to install
*/
void installDownloadedIndex(Book book, URI tempDest) throws BookException;
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndexManager.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndexManager.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndexManager.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -131,7 +131,7 @@
}
/* (non-Javadoc)
- * @see org.crosswire.jsword.index.search.IndexManager#installDownloadedIndex(org.crosswire.jsword.book.Book, java.net.URL)
+ * @see org.crosswire.jsword.index.search.IndexManager#installDownloadedIndex(org.crosswire.jsword.book.Book, java.net.URI)
*/
public void installDownloadedIndex(Book book, URI tempDest) throws BookException
{
@@ -178,7 +178,7 @@
/**
* Determine where an index should be stored
* @param book The book to be indexed
- * @return A URL to store stuff in
+ * @return A URI to store stuff in
* @throws IOException If there is a problem in finding where to store stuff
*/
protected URI getStorageArea(Book book) throws IOException
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java 2007-06-01 11:12:58 UTC (rev 1362)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java 2007-06-01 11:13:08 UTC (rev 1363)
@@ -98,8 +98,8 @@
try
{
- URI urlcache = getTempScratchSpace(DIR_NETCACHE, true);
- File filecache = new File(urlcache.getPath());
+ URI uricache = getTempScratchSpace(DIR_NETCACHE, true);
+ File filecache = new File(uricache.getPath());
NetUtil.setURICacheDir(filecache);
}
catch (IOException ex)
More information about the jsword-svn
mailing list