|
||||||||||
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
.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
protected String |
catalogDirectory
The directory containing the catalog of all books 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. |
protected String |
indexDirectory
The directory containing the catalog of all books on the host . |
protected boolean |
loaded
Do we need to reload the index file |
private static Logger |
log
The log stream |
protected String |
packageDirectory
The directory containing zipped books on the host . |
protected String |
proxyHost
The remote proxy hostname. |
protected Integer |
proxyPort
The remote proxy port. |
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 books on this server |
Constructor Summary | |
---|---|
AbstractSwordInstaller()
|
Method Summary | |
---|---|
int |
compareTo(Object arg0)
|
protected abstract void |
download(Progress job,
String dir,
String file,
URI dest)
Utility to download a file from a remote site |
void |
downloadSearchIndex(Book book,
URI 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 |
Book |
getBook(String name)
Get a Book matching the name from the local cache. |
List |
getBooks()
Get a list of BookMetaData objects that represent downloadable books. |
List |
getBooks(BookFilter filter)
Get a filtered list of all the Books. |
protected URI |
getCachedIndexFile()
The URL for the cached index file for this installer |
String |
getCatalogDirectory()
|
String |
getHost()
|
String |
getIndexDirectory()
|
String |
getInstallerDefinition()
Accessor for the URI |
String |
getPackageDirectory()
|
String |
getProxyHost()
|
Integer |
getProxyPort()
|
private static String |
getTempFileExtension(String host,
String catalogDir)
What are we using as a temp filename? |
int |
hashCode()
|
void |
install(Book book)
Download and install a book locally. |
boolean |
isNewer(Book book)
Return true if the book 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 |
setCatalogDirectory(String catologDirectory)
|
void |
setHost(String newHost)
|
void |
setIndexDirectory(String indexDirectory)
|
void |
setPackageDirectory(String newDirectory)
|
void |
setProxyHost(String newProxyHost)
|
void |
setProxyPort(Integer newProxyPort)
|
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.install.Installer |
---|
getSize, getType, toRemoteURI |
Methods inherited from interface org.crosswire.jsword.book.BookList |
---|
addBooksListener, removeBooksListener |
Field Detail |
---|
protected Map entries
protected String host
protected String proxyHost
protected Integer proxyPort
protected String packageDirectory
host
.
protected String catalogDirectory
host
.
protected String indexDirectory
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(Progress job, String dir, String file, URI dest) throws InstallException
job
- The way of noting progressdir
- The directory from which to download the filefile
- The file to download
InstallException
public String getInstallerDefinition()
Installer
getInstallerDefinition
in interface Installer
public boolean isNewer(Book book)
Installer
isNewer
in interface Installer
book
- The book meta-data to check on.
public List getBooks()
Installer
getBooks
in interface BookList
getBooks
in interface Installer
Installer.reloadBookList()
public Book getBook(String name)
Installer
getBook
in interface Installer
public List getBooks(BookFilter filter)
BookList
getBooks
in interface BookList
getBooks
in class AbstractBookList
BookFilters
public void install(Book book)
Installer
install
in interface Installer
book
- The book to installpublic void reloadBookList() throws InstallException
Installer
reloadBookList
in interface Installer
InstallException
public void downloadSearchIndex(Book book, URI localDest) throws InstallException
Installer
downloadSearchIndex
in interface Installer
book
- The book to download a search index for.localDest
- A temporary URI for downloading to. Passed to the
BookIndexer for installation.
InstallException
private void loadCachedIndex() throws InstallException
InstallException
public String getCatalogDirectory()
public void setCatalogDirectory(String catologDirectory)
catologDirectory
- the catologDirectory to setpublic String getPackageDirectory()
public void setPackageDirectory(String newDirectory)
newDirectory
- The directory to set.public String getIndexDirectory()
public void setIndexDirectory(String indexDirectory)
indexDirectory
- the indexDirectory to setpublic String getHost()
public void setHost(String newHost)
newHost
- The host to set.public String getProxyHost()
public void setProxyHost(String newProxyHost)
newProxyHost
- The proxyHost to set.public Integer getProxyPort()
public void setProxyPort(Integer newProxyPort)
newProxyPort
- The proxyPort to set.protected URI getCachedIndexFile() throws InstallException
InstallException
private static String getTempFileExtension(String host, String catalogDir)
public boolean equals(Object object)
equals
in class Object
public int compareTo(Object arg0)
compareTo
in interface Comparable
public int hashCode()
hashCode
in class Object
protected boolean equals(String string1, String string2)
|
Copyright ยจ 2003-2007 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |