org.crosswire.jsword.book.install.sword
Class HttpSwordInstaller

java.lang.Object
  extended by org.crosswire.jsword.book.basic.AbstractBookList
      extended by org.crosswire.jsword.book.install.sword.AbstractSwordInstaller
          extended by org.crosswire.jsword.book.install.sword.HttpSwordInstaller
All Implemented Interfaces:
Comparable, BookList, Installer

public class HttpSwordInstaller
extends AbstractSwordInstaller

An implementation of Installer for reading data from Sword Web sites.

Author:
Mark Goodwin [goodwinster at gmail dot com], Joe Walker [joe at eireneh dot com], DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Field Summary
 
Fields inherited from class org.crosswire.jsword.book.install.sword.AbstractSwordInstaller
catalogDirectory, DOWNLOAD_PREFIX, entries, FILE_LIST_GZ, host, indexDirectory, loaded, packageDirectory, proxyHost, proxyPort, SEARCH_DIR, ZIP_SUFFIX
 
Constructor Summary
HttpSwordInstaller()
           
 
Method Summary
private  void copy(Progress job, URI uri, URI dest)
           
protected  void download(Progress job, String dir, String file, URI dest)
          Utility to download a file from a remote site
 boolean equals(Object object)
           
 int getSize(Book book)
          Return true if the book is not installed or there is a newer version to install.
 String getType()
          Get the type of the Installer.
 int hashCode()
           
 URI toRemoteURI(Book book)
           
 
Methods inherited from class org.crosswire.jsword.book.install.sword.AbstractSwordInstaller
compareTo, downloadSearchIndex, equals, getBook, getBooks, getBooks, getCachedIndexFile, getCatalogDirectory, getHost, getIndexDirectory, getInstallerDefinition, getPackageDirectory, getProxyHost, getProxyPort, install, isNewer, reloadBookList, setCatalogDirectory, setHost, setIndexDirectory, setPackageDirectory, setProxyHost, setProxyPort
 
Methods inherited from class org.crosswire.jsword.book.basic.AbstractBookList
addBooksListener, fireBooksChanged, removeBooksListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.crosswire.jsword.book.BookList
addBooksListener, removeBooksListener
 

Constructor Detail

HttpSwordInstaller

public HttpSwordInstaller()
Method Detail

getType

public String getType()
Description copied from interface: Installer
Get the type of the Installer.

Returns:
the type of the installer

getSize

public int getSize(Book book)
Description copied from interface: Installer
Return true if the book is not installed or there is a newer version to install.

Parameters:
book - The book meta-data to check on.
Returns:
whether there is a newer version to install

toRemoteURI

public URI toRemoteURI(Book book)
Parameters:
book - The book meta-data to get a URI from.
Returns:
the remote uri for the BookMetaData

download

protected void download(Progress job,
                        String dir,
                        String file,
                        URI dest)
                 throws InstallException
Description copied from class: AbstractSwordInstaller
Utility to download a file from a remote site

Specified by:
download in class AbstractSwordInstaller
Parameters:
job - The way of noting progress
dir - The directory from which to download the file
file - The file to download
Throws:
InstallException

copy

private void copy(Progress job,
                  URI uri,
                  URI dest)
           throws LucidException
Parameters:
job -
uri -
dest -
Throws:
LucidException

equals

public boolean equals(Object object)
Overrides:
equals in class AbstractSwordInstaller

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractSwordInstaller

Copyright ยจ 2003-2007