IndexDatabase.java revision 889
207N/A * See LICENSE.txt included in this distribution for the specific
207N/A * file and include the License file at LICENSE.txt.
207N/Apublic class IndexDatabase {
207N/A private boolean interrupted;
207N/A initialize();
207N/A initialize();
207N/A static void updateAll(ExecutorService executor, IndexChangedListener listener) throws IOException {
207N/A public static void update(ExecutorService executor, IndexChangedListener listener, List<String> paths) throws IOException {
207N/A } catch (IOException e) {
207N/A throw new FileNotFoundException("Failed to create root directory [" + indexDir.getAbsolutePath() + "]");
207N/A throw new FileNotFoundException("Failed to create root directory [" + spellDir.getAbsolutePath() + "]");
207N/A interrupted = false;
207N/A //TODO we might need to add writer.commit after certain phases of index generation, right now it will only happen in the end
207N/A writer = new IndexWriter(indexDirectory, AnalyzerGuru.getAnalyzer(),IndexWriter.MaxFieldLength.UNLIMITED);
207N/A while (uidIter.term() != null && uidIter.term().field().equals("u") && uidIter.term().text().startsWith(startuid)) {
207N/A removeFile();
207N/A } catch (IOException e) {
207N/A } catch (IOException e) {
207N/A log.warning("Failed to set last modified time on '" + timestamp.getAbsolutePath() + "', used for timestamping the index database.");
207N/A log.warning("Failed to create file '" + timestamp.getAbsolutePath() + "', used for timestamping the index database.");
207N/A } catch (IOException e) {
207N/A } catch (IOException e) {
207N/A public void createSpellingSuggestions() {
207N/A } catch (IOException e) {
207N/A } catch (IOException e) {
207N/A } catch (IOException e) {
//below will only let go files and directories, anything else is considered special and is not added
if (isInterrupted()) {
String uid = Util.uid(path, DateTools.timeToString(file.lastModified(), DateTools.Resolution.MILLISECOND)); // construct uid for doc
removeFile();
} catch (Exception e) {
public void interrupt() {
synchronized (lock) {
interrupted = true;
private boolean isInterrupted() {
synchronized (lock) {
return interrupted;
} catch (IOException e) {
} catch (IOException e) {
} catch (IOException e) {
} catch (IOException e) {
if (p == null) {
return null;
return ret;
if (this.project != other.project && (this.project == null || !this.project.equals(other.project))) {
public int hashCode() {
return hash;