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
implements Comparable

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

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: HttpSwordInstaller.java,v 1.21 2005/03/22 12:40:03 dmsmith Exp $
Author:
Mark Goodwin [goodwinster at gmail dot com], Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private static String PROTOCOL_WEB
          We need to be ablee to provide a URL as part of the API
 
Fields inherited from class org.crosswire.jsword.book.install.sword.AbstractSwordInstaller
directory, DOWNLOAD_PREFIX, entries, FILE_LIST_GZ, host, loaded, PACKAGE_DIR, SEARCH_DIR, ZIP_SUFFIX
 
Constructor Summary
HttpSwordInstaller()
           
 
Method Summary
private  void copy(Job job, URL url, URL dest)
           
protected  void download(Job job, String dir, String file, URL dest)
          Utility to download a file from a remote site
 boolean equals(Object object)
           
 String getURL()
          Accessor for the URL
 int hashCode()
           
 URL toRemoteURL(Book book)
           
 
Methods inherited from class org.crosswire.jsword.book.install.sword.AbstractSwordInstaller
compareTo, downloadSearchIndex, equals, getBooks, getCachedIndexFile, getDirectory, getHost, install, isNewer, reloadBookList, setDirectory, setHost
 
Methods inherited from class org.crosswire.jsword.book.basic.AbstractBookList
addBooksListener, fireBooksChanged, getBooks, removeBooksListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.crosswire.jsword.book.BookList
addBooksListener, getBooks, removeBooksListener
 

Field Detail

PROTOCOL_WEB

private static final String PROTOCOL_WEB
We need to be ablee to provide a URL as part of the API

See Also:
Constant Field Values
Constructor Detail

HttpSwordInstaller

public HttpSwordInstaller()
Method Detail

getURL

public String getURL()
Description copied from interface: Installer
Accessor for the URL

Specified by:
getURL in interface Installer
Returns:
the source url

toRemoteURL

public URL toRemoteURL(Book book)
Specified by:
toRemoteURL in interface Installer
Parameters:
book - The book meta-data to get a URL from.
Returns:
the remote url for the BookMetaData

download

protected void download(Job job,
                        String dir,
                        String file,
                        URL 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(Job job,
                  URL url,
                  URL dest)
           throws IOException,
                  InstallException
Parameters:
job -
url -
dest -
Throws:
IOException
InstallException

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractSwordInstaller

Copyright ? 2003-2004