Package com.github.oeuvres.alix.cli
Class Load
java.lang.Object
com.github.oeuvres.alix.cli.Load
Load an XML/TEI corpus in a custom Lucene index for Alix.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()static voidSend index loading.static StringFactor construction of old index name.static StringFactor construction of temp index name.voidParse properties to produce an alix lucene indexvoidWrite documents to a lucene index.voidA logic to write safely an index in a temp directory before affecting a running index.voidwriteUnsafe(File dstdir, String name) Because a bug in Microsoft.Windows filesystem with Java, impossible to have the same safe indexation like for unix.
-
Field Details
-
APP
Prefix for log lines.
-
-
Constructor Details
-
Load
public Load()Default constructor.
-
-
Method Details
-
call
-
parse
Parse properties to produce an alix lucene index- Parameters:
propsFile- A properties file in XML formatProperties.loadFromXML(java.io.InputStream).- Throws:
IOException- I/O file system error, or required files not found.NoSuchFieldException- Properties errors.
-
nameOld
Factor construction of old index name.- Parameters:
name- An index name.- Returns:
- Name of an old index.
-
nameTmp
Factor construction of temp index name.- Parameters:
name- An index name.- Returns:
- Name of temp index.
-
write
Write documents to a lucene index.- Parameters:
name- Name of the base.path- Path where to write the path index.- Throws:
Exception- Errors in the XML parsing.
-
writeSafe
A logic to write safely an index in a temp directory before affecting a running index.- Parameters:
dstDir- Destination parent file directory.name- Name of the index to write.- Throws:
Exception- Errors during XML process and Lucene indexation.
-
writeUnsafe
Because a bug in Microsoft.Windows filesystem with Java, impossible to have the same safe indexation like for unix.- Parameters:
dstdir- Parent destination file system directory.name- Name of a lucene index.- Throws:
Exception- XML or Lucene erros.
-
main
Send index loading.- Parameters:
args- Command line arguments.- Throws:
Exception- XML or Lucene errors.
-