List of usage examples for org.eclipse.jgit.storage.file FileBasedConfig getInt
public int getInt(final String section, final String name, final int defaultValue)
From source file:com.gitblit.LuceneExecutor.java
License:Apache License
/** * Reads the Lucene config file for the repository to check the index * version. If the index version is different, then rebuild the repository * index.//from w w w. j av a2 s . c o m * * @param repository * @return true of the on-disk index format is different than INDEX_VERSION */ private boolean shouldReindex(Repository repository) { try { FileBasedConfig config = getConfig(repository); config.load(); int indexVersion = config.getInt(CONF_INDEX, CONF_VERSION, 0); // reindex if versions do not match return indexVersion != INDEX_VERSION; } catch (Throwable t) { } return true; }