org.crosswire.jsword.index.lucene
Class InstalledIndex
java.lang.Object
org.crosswire.jsword.index.lucene.InstalledIndex
public final class InstalledIndex
- extends Object
A singleton that Reads and Maintains Installed Index Metadata (for e.g.
version indexed on client machine) in properties file If file does not exist
on the client, it will be created File location:
{WritableProjectDir}/JSword/lucene
/org.crosswire.jsword.index.lucene.InstalledIndex.properties
- Author:
- Sijo Cherian
- See Also:
The GNU Lesser General Public License for details.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTALLED_INDEX_DEFAULT_VERSION
public static final String INSTALLED_INDEX_DEFAULT_VERSION
- See Also:
- Constant Field Values
PREFIX_INSTALLED_INDEX_VERSION_BOOK_OVERRIDE
public static final String PREFIX_INSTALLED_INDEX_VERSION_BOOK_OVERRIDE
- See Also:
- Constant Field Values
DEFAULT_INSTALLED_INDEX_VERSION
public static final float DEFAULT_INSTALLED_INDEX_VERSION
- The Index version for new indexes
- See Also:
- Constant Field Values
props
private PropertyMap props
writeLock
private Object writeLock
metadataFileComment
private static String metadataFileComment
myInstance
private static InstalledIndex myInstance
log
private static final org.slf4j.Logger log
InstalledIndex
private InstalledIndex()
instance
public static InstalledIndex instance()
- All access through this single instance.
- Returns:
- the singleton instance
getInstalledIndexDefaultVersion
public float getInstalledIndexDefaultVersion()
getInstalledIndexVersion
public float getInstalledIndexVersion(Book b)
storeLatestVersionAsInstalledIndexMetadata
public void storeLatestVersionAsInstalledIndexMetadata(Book b)
throws IOException
- Throws:
IOException
getPropertyFileURI
public URI getPropertyFileURI()
storeInstalledIndexMetadata
protected void storeInstalledIndexMetadata()
throws IOException
- Throws:
IOException
storeInstalledIndexMetadata
public void storeInstalledIndexMetadata(PropertyMap updateProps)
throws IOException
- Use this method to add/update custom property in the metadata file. Note:
If all the installed books indices have been upgraded/downloaded, client
can pass in property InstalledIndex.INSTALLED_INDEX_DEFAULT_VERSION =
<VersionToStore>, for e.g for client managed downloadable index
- Parameters:
updateProps
-
- Throws:
IOException
storeInstalledIndexMetadata
public void storeInstalledIndexMetadata(Book b,
String installedIndexVersionToStore)
throws IOException
- Throws:
IOException
removeFromInstalledIndexMetadata
public void removeFromInstalledIndexMetadata(Book b)
throws IOException
- Throws:
IOException