int updatePolicy = 0;
boolean tempBool = false;
boolean tempWebBool = false;
boolean tempIsCdrom = false;
if (testIndex.exists()) {
Table tempTable = new Table(11, 100);
tempTable.htmlLoad(indexFileName, "");
int numI = tempTable.colSize();
// parse it
for (int i = 0; i < numI; i++) {
//
try {
String tempDesc = tempTable.inItem(0, i);
String tempFileString = tempTable.inItem(1, i);
int tempSbd = Integer.parseInt(tempTable.inItem(2, i));
String tempIndexerPath = tempTable.inItem(4, i);
// isWeb content
String tempIsWeb = tempTable.inItem(5, i);
tempWebBool = false;
String tempReplace = "";
String tempMatch = "";
if (tempIsWeb != null) {
if (tempIsWeb.equals("true")) {
tempWebBool = true;
tempMatch = tempTable.inItem(6, i);
tempReplace = tempTable.inItem(7, i);
}
}
// CDROM Stuff tempIsCdrom tempReplaceStr
String tempMatchStr = tempTable.inItem(6, i);
if (tempMatchStr != null) {
if (tempMatchStr.startsWith("[cdrom]")) {
tempMatch = tempTable.inItem(6, i);
tempIsCdrom = true;
tempReplace = tempTable.inItem(7, i);
// cdRomIdxDir
if (isCDSearchTool) {
tempIndexerPath = FileUtils.addFolder(cdRomIdxDir, Utils.getNameOnly(tempIndexerPath));
}
logger.info("loadIndexes() Using CDROM Lucene index path: " + tempIndexerPath);
}
}
String tempDateStr = tempTable.inItem(8, i);
String updateStr = tempTable.inItem(9, i);
if (updateStr == null) {
updatePolicy = 0;
}
else {
updatePolicy = Integer.parseInt(updateStr);
}
if (tempDateStr == null) {
tempDateStr = DateTimeUtils.getToday();
}
if (tempSbd == 1) {
tempBool = false;
}
else {
tempBool = true;
}
String tempArch = tempTable.inItem(10, i);
if (tempArch == null) {
tempArch = fEnv.getArchiveDirectory();
}
tempDepth = Integer.parseInt(tempTable.inItem(3, i));
File tempFile = new File(tempFileString);
if (tempFileString.toLowerCase().endsWith(".zip")) {
curI = new DocSearcherIndex(tempFileString, tempDesc, tempBool, tempDepth, tempIndexerPath, tempWebBool, tempMatch, tempReplace, tempDateStr, updatePolicy, tempArch);
indexes.add(curI);
if (env.isGUIMode()) {
setStatus(I18n.getString("index")
+ " "
+ curI.getDescription()
+ " : "
+ DateTimeUtils.getDaysOld(curI.getLastIndexed())
+ " "
+ I18n.getString("days_old")
+ " : "
+ curI.getLastIndexed());
}
numIndexes++;
}
else if (tempIsCdrom) {
curI = new DocSearcherIndex(tempFileString, tempDesc, tempBool, tempDepth, tempIndexerPath, tempWebBool, tempMatch, tempReplace, tempDateStr, updatePolicy, tempArch);
indexes.add(curI);
setStatus(I18n.getString("index")
+ " "
+ curI.getDescription()
+ " : "
+ DateTimeUtils.getDaysOld(curI.getLastIndexed())
+ " "
+ I18n.getString("days_old")
+ " : "
+ curI.getLastIndexed());
numIndexes++;
}
else if ((tempFile.exists()) || (tempFileString.startsWith("http"))) {
curI = new DocSearcherIndex(tempFileString, tempDesc, tempBool, tempDepth, tempIndexerPath, tempWebBool, tempMatch, tempReplace, tempDateStr, updatePolicy, tempArch);
indexes.add(curI);
setStatus(I18n.getString("index")
+ " " + curI.getDescription()
+ " : "
+ DateTimeUtils.getDaysOld(curI.getLastIndexed())
+ " "
+ I18n.getString("days_old")
+ " : "
+ curI.getLastIndexed());
numIndexes++;
}
else {
loadErr = true;
errS.append(tempFileString)
.append("\n\t")
.append(I18n.getString("lower_not_exist"))
.append("\n\n");
}
// end for file doesn't exist
}
catch (Exception e) {
loadErr = true;
errS.append(e.toString())
.append("\n\n");
}
}
}
if (numIndexes == 0) {
loadErr = true;
errS.append(dsMkIdx);
}
// now load the bookmarks
// from the bookmarksFile
File testBMF = new File(fEnv.getBookmarkFile());
if (testBMF.exists()) {
Table tempTable = new Table(2, 200);
tempTable.htmlLoad(fEnv.getBookmarkFile(), "");
int numI = tempTable.colSize();
// parse it
for (int i = 0; i < numI; i++) {
addNewBookmark(new SimpleBookmark(tempTable.inItem(1, i), tempTable.inItem(0, i)));
}
}
if (loadErr) {
showMessage(I18n.getString("error_loading_index"), errS.toString());