org.crosswire.jsword.book.install.sword

## Class HttpSwordInstaller

- java.lang.Object
- - org.crosswire.jsword.book.AbstractBookList
  - - org.crosswire.jsword.book.install.sword.AbstractSwordInstaller
    - - org.crosswire.jsword.book.install.sword.HttpSwordInstaller

- All Implemented Interfaces:
    Comparable<AbstractSwordInstaller>, BookList, Installer

      public class HttpSwordInstaller
      extends AbstractSwordInstaller

  An implementation of Installer for reading data from Sword Web sites.
  Author:
    Mark Goodwin, Joe Walker, DM Smith
  See Also:
    `The GNU Lesser General Public License for details.`

- - ### Field Summary

    - ### Fields inherited from class org.crosswire.jsword.book.install.sword.AbstractSwordInstaller

      `catalogDirectory, CONF_DIR, DOWNLOAD_PREFIX, entries, FILE_LIST_GZ, host, indexDirectory, loaded, log, packageDirectory, proxyHost, proxyPort, SEARCH_DIR, ZIP_SUFFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpSwordInstaller()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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

      `close, compareTo, downloadSearchIndex, getBook, getBooks, getBooks, getCachedIndexDir, getCachedIndexFile, getCatalogDirectory, getHost, getIndexDirectory, getInstallerDefinition, getPackageDirectory, getProxyHost, getProxyPort, install, isNewer, loadCachedIndex, reloadBookList, setCatalogDirectory, setHost, setIndexDirectory, setPackageDirectory, setProxyHost, setProxyPort, unpack`

    - ### Methods inherited from class org.crosswire.jsword.book.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`