use of net.jforum.exceptions.ForumException in project jforum2 by rafaelsteil.
the class LuceneManager method init.
/**
* @see net.jforum.search.SearchManager#init()
*/
public void init() {
try {
Analyzer analyzer = (Analyzer) Class.forName(SystemGlobals.getValue(ConfigKeys.LUCENE_ANALYZER)).newInstance();
this.settings = new LuceneSettings(analyzer);
this.settings.useFSDirectory(SystemGlobals.getValue(ConfigKeys.LUCENE_INDEX_WRITE_PATH));
this.removeLockFile();
this.indexer = new LuceneIndexer(this.settings);
this.search = new LuceneSearch(this.settings, new LuceneContentCollector(this.settings));
this.indexer.watchNewDocuDocumentAdded(this.search);
SystemGlobals.setObjectValue(ConfigKeys.LUCENE_SETTINGS, this.settings);
} catch (Exception e) {
throw new ForumException(e);
}
}
use of net.jforum.exceptions.ForumException in project jforum2 by rafaelsteil.
the class SystemGlobals method loadAdditionalDefaults.
/**
* Merge additional configuration defaults
*
* @param file File from which to load the additional defaults
*/
public static void loadAdditionalDefaults(String file) {
if (!new File(file).exists()) {
logger.info("Cannot find file " + file + ". Will ignore it");
return;
}
try {
FileInputStream input = new FileInputStream(file);
globals.installation.load(input);
input.close();
} catch (IOException e) {
throw new ForumException(e);
}
if (!additionalDefaultsList.contains(file)) {
additionalDefaultsList.add(file);
}
}
Aggregations