|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.basic.AbstractBookDriver
org.crosswire.jsword.book.sword.SwordBookDriver
public class SwordBookDriver
This represents all of the SwordBibles.
for license details.
The copyright to this program is held by it's authors.
Nested Class Summary | |
---|---|
(package private) static class |
SwordBookDriver.CustomFilenameFilter
Check that the directories in the version directory really represent versions. |
Field Summary | |
---|---|
private static String |
DIR_SWORD_CONF
Users config directory for Sword in Unix |
private static String |
DIR_UNIX_GLOBAL_CONF
Sword global config file |
private static String |
DIR_WINDOWS_DEFAULT
Default windows installation directory |
private static File[] |
dirs
The directory URL |
static File[] |
EMPTY_FILE_ARRAY
An empty immutable File array. |
private static BookDriver |
INSTANCE
A shared instance of this driver. |
private static Logger |
log
The log stream |
private static String |
PREFIX_GLOBALS
File prefix for config file |
private static String |
PROPERTY_SWORD_HOME
System property for sword home directory |
private static String |
PROPERTY_USER_HOME
Java system property for users home directory |
Constructor Summary | |
---|---|
SwordBookDriver()
Some basic name initialization |
Method Summary | |
---|---|
private Book |
createBook(SwordBookMetaData sbmd,
File progdir)
Create a Book appropriate for the BookMetaData |
void |
delete(Book dead)
Delete this Book from the system. |
Book[] |
getBooks()
This method should only be used by Bibles at startup to register the Bibles known at start time. |
private static File[] |
getDefaultPaths()
Have an OS dependent guess at where Sword might be installed |
static File |
getDownloadDir()
|
String |
getDriverName()
A short name for this BookDriver |
static File[] |
getSwordPath()
Accessor for the Sword directory |
static BookDriver |
instance()
Get the singleton instance of this driver. |
boolean |
isDeletable(Book dead)
Is this book able to be deleted. |
static void |
registerNewBook(SwordBookMetaData sbmd,
File bookpath)
A helper class for the FtpSwordInstaller to tell us that it has copied a new Book into our install directory |
static void |
setDownloadDir(File downloadDir)
|
static void |
setSwordPath(File[] theNewDirs)
Accessor for the Sword directory |
private static void |
testDefaultPath(List reply,
String path)
Check to see if the given directory is a Sword mods.d directory and then add it to the list if it is. |
private static File[] |
validateSwordPath(File[] theFiles)
validateSwordPath maintains the invariant that the download location is first in the list. |
Methods inherited from class org.crosswire.jsword.book.basic.AbstractBookDriver |
---|
create, isWritable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final File[] EMPTY_FILE_ARRAY
File
array.
private static final String DIR_WINDOWS_DEFAULT
private static final String DIR_SWORD_CONF
private static final String DIR_UNIX_GLOBAL_CONF
private static final String PROPERTY_SWORD_HOME
private static final String PROPERTY_USER_HOME
private static final String PREFIX_GLOBALS
private static final BookDriver INSTANCE
private static File[] dirs
private static final Logger log
Constructor Detail |
---|
public SwordBookDriver()
Method Detail |
---|
public String getDriverName()
BookDriver
public Book[] getBooks()
BookDriver
public boolean isDeletable(Book dead)
BookDriver
isDeletable
in interface BookDriver
isDeletable
in class AbstractBookDriver
dead
- the book to be deleted
public void delete(Book dead) throws BookException
BookDriver
delete
in interface BookDriver
delete
in class AbstractBookDriver
BookException
- If the Book can't be deleted.public static BookDriver instance()
public static void registerNewBook(SwordBookMetaData sbmd, File bookpath) throws BookException
sbmd
- The SwordBookMetaData object for the new Bookbookpath
- The path that we have installed to
BookException
private Book createBook(SwordBookMetaData sbmd, File progdir) throws BookException
BookException
public static void setSwordPath(File[] theNewDirs) throws BookException
theNewDirs
- The new Sword directory
BookException
private static File[] validateSwordPath(File[] theFiles)
theFiles
-
public static File[] getSwordPath()
private static File[] getDefaultPaths()
private static void testDefaultPath(List reply, String path)
public static File getDownloadDir()
public static void setDownloadDir(File downloadDir)
downloadDir
- The download directory to set.
|
Copyright ยจ 2003-2006 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |