|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.omdocjdom.lucene.LuceneUtilities
public class LuceneUtilities
This is utitlity class of Lucence base MBase implementation.
| Field Summary | |
|---|---|
static HashSet |
INDEXER_ITEMS
|
static HashSet |
NONVISIBLEITEMS
|
static HashSet |
OJITEMS
|
| Constructor Summary | |
|---|---|
LuceneUtilities()
|
|
| Method Summary | |
|---|---|
static Iterator |
computeMetadataAttributes(OJElement metadataElt)
Goes through the metadata and returns any element-name followed by ":" and a sole attribute of any child provided it is not relation and it is not in the OJConstants.DC_NAMESPACE. |
static void |
copyFile(File from,
File to)
Copies a file from one location to another. |
static void |
createBackUp(String location)
This method creates a back up of existing database. |
static boolean |
deletePath(String path)
|
org.jdom.Element |
dublicateElementWithoutDependency(org.jdom.Element source)
|
static int |
getLuceneBuild(File file)
this method get build number of lucene database. |
static OJElement |
getorMakeMetadataExtradata(OJElement source)
This method extracts extra data from the source element. |
static String |
getXMLText(org.jdom.Element elt)
This method build indent xml text from the given Element object |
static String |
getXMLText(org.jdom.Element elt,
boolean withRoot)
|
protected static HashSet |
initIndexerItems()
|
protected static HashSet |
initNonVisibleItems()
|
protected static HashSet |
initOJItems()
|
static boolean |
isIndexerItem(String name)
This method tells whether the indexer will create the index of this item or not. |
static boolean |
isLuceneMBaseItem(String name)
|
static boolean |
isNonVisibleItem(String name)
|
static void |
main(String[] args)
|
static void |
makeSureTheresAnIndexAt(File dir)
Tries to read the index and create it if necessary. |
static boolean |
recoverDB(String location)
If the database is crashed during the previous update then this procedure will try to recover the database. |
static int |
setLuceneBuild(File file)
this method increment the build number in lucene |
static List |
split(String source,
String del)
A utility method to return the extradata child of the item
and create it, if it is missing. |
static Reader |
wrapReader(Reader origin,
String start,
String end)
|
static void |
writeDocument(org.jdom.Document doc,
File file)
This method build indent xml text from the given org.jdom.Document object then write it in the file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final HashSet INDEXER_ITEMS
public static final HashSet OJITEMS
public static final HashSet NONVISIBLEITEMS
| Constructor Detail |
|---|
public LuceneUtilities()
| Method Detail |
|---|
public static String getXMLText(org.jdom.Element elt)
Element object
elt - Source element
public static String getXMLText(org.jdom.Element elt,
boolean withRoot)
public static void makeSureTheresAnIndexAt(File dir)
throws IOException
dir - directory where the index is to be
IOException - if low-level write errors occur
IllegalStateException - is something else happens.
public static void writeDocument(org.jdom.Document doc,
File file)
throws IOException
org.jdom.Document object then write it in the file
doc - Document Source document
IOExceptionprotected static HashSet initIndexerItems()
protected static HashSet initOJItems()
public static boolean isLuceneMBaseItem(String name)
protected static HashSet initNonVisibleItems()
public static boolean isNonVisibleItem(String name)
public static boolean isIndexerItem(String name)
name - the item name.
public static List split(String source,
String del)
extradata child of the item
and create it, if it is missing.
public final org.jdom.Element dublicateElementWithoutDependency(org.jdom.Element source)
public static OJElement getorMakeMetadataExtradata(OJElement source)
source - an OJElement value. Source element.
OJElement value. It contains the extradata
for the source element.
public static boolean recoverDB(String location)
throws IOException
IOException
public static void createBackUp(String location)
throws IOException
IOException
public static int setLuceneBuild(File file)
throws IOException
file -
IOException
public static int getLuceneBuild(File file)
throws IOException
file -
IOException
public static void copyFile(File from,
File to)
throws IOException
from - source fileto - destination file
IOExceptionpublic static boolean deletePath(String path)
public static Iterator computeMetadataAttributes(OJElement metadataElt)
relationand it is not in the
OJConstants.DC_NAMESPACE.
public static Reader wrapReader(Reader origin,
String start,
String end)
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||