|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.basic.AbstractBookList
org.crosswire.jsword.book.install.sword.AbstractSwordInstaller
public abstract class AbstractSwordInstaller
.
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. |
Licence
Field Summary | |
---|---|
protected String |
directory
The directory containing modules on the host . |
protected static String |
DOWNLOAD_PREFIX
When we cache a download index |
protected Map |
entries
A map of the entries in this download area |
protected static String |
FILE_LIST_GZ
The sword index file |
protected String |
host
The remote hostname. |
private static String |
LIST_DIR
The relative path of the dir holding the index file |
protected boolean |
loaded
Do we need to reload the index file |
private static Logger |
log
The log stream |
protected static String |
PACKAGE_DIR
The relative path of the dir holding the zip files |
protected static String |
SEARCH_DIR
The relative path of the dir holding the search index files |
protected static String |
ZIP_SUFFIX
The suffix of zip modules on this server |
Constructor Summary | |
---|---|
AbstractSwordInstaller()
|
Method Summary | |
---|---|
int |
compareTo(Object arg0)
|
protected abstract void |
download(Job job,
String dir,
String file,
URL dest)
Utility to download a file from a remote site |
void |
downloadSearchIndex(Book book,
URL localDest)
Download a search index for the given Book. |
boolean |
equals(Object object)
|
protected boolean |
equals(String string1,
String string2)
Quick utility to check to see if 2 (potentially null) strings are equal |
List |
getBooks()
Get an iterator over all the Books of all types. |
protected URL |
getCachedIndexFile()
The URL for the cached index file for this installer |
String |
getDirectory()
|
String |
getHost()
|
private static String |
getTempFileExtension(String host,
String directory)
What are we using as a temp filename? |
int |
hashCode()
|
void |
install(Book book)
Download and install a module locally. |
boolean |
isNewer(Book book)
Return true if the module is not installed or there is a newer version to install. |
private void |
loadCachedIndex()
Load the cached index file into memory |
void |
reloadBookList()
Refetch a list of names from the remote source. |
void |
setDirectory(String directory)
|
void |
setHost(String host)
|
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 org.crosswire.jsword.book.install.Installer |
---|
getURL, toRemoteURL |
Methods inherited from interface org.crosswire.jsword.book.BookList |
---|
addBooksListener, getBooks, removeBooksListener |
Field Detail |
---|
protected static final String PACKAGE_DIR
private static final String LIST_DIR
protected Map entries
protected String host
protected String directory
host
.
protected boolean loaded
protected static final String FILE_LIST_GZ
protected static final String ZIP_SUFFIX
private static final Logger log
protected static final String SEARCH_DIR
protected static final String DOWNLOAD_PREFIX
Constructor Detail |
---|
public AbstractSwordInstaller()
Method Detail |
---|
protected abstract void download(Job job, String dir, String file, URL dest) throws InstallException
job
- The way of noting progressdir
- The directory from which to download the filefile
- The file to download
InstallException
public boolean isNewer(Book book)
Installer
isNewer
in interface Installer
book
- The book meta-data to check on.
public List getBooks()
BookList
getBooks
in interface BookList
getBooks
in interface Installer
Installer.reloadBookList()
public void install(Book book)
Installer
install
in interface Installer
book
- The module to installpublic void reloadBookList() throws InstallException
Installer
reloadBookList
in interface Installer
InstallException
public void downloadSearchIndex(Book book, URL localDest) throws InstallException
Installer
downloadSearchIndex
in interface Installer
book
- The book to download a search index for.localDest
- A temporary URL for downloading to. Passed to the
IndexManager for installation.
InstallException
private void loadCachedIndex() throws InstallException
InstallException
public String getDirectory()
public void setDirectory(String directory)
directory
- The directory to set.public String getHost()
public void setHost(String host)
host
- The host to set.protected URL getCachedIndexFile() throws InstallException
InstallException
private static String getTempFileExtension(String host, String directory)
public boolean equals(Object object)
equals
in class Object
public int compareTo(Object arg0)
public int hashCode()
hashCode
in class Object
protected boolean equals(String string1, String string2)
|
Copyright ? 2003-2004 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |