IndexDatabase.java revision 922
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 {
253N/A private boolean interrupted;
207N/A initialize();
207N/A initialize();
564N/A static void updateAll(ExecutorService executor, IndexChangedListener listener) throws IOException {
460N/A public static void update(ExecutorService executor, IndexChangedListener listener, List<String> paths) throws IOException {
274N/A } catch (IOException e) {
207N/A throw new FileNotFoundException("Failed to create root directory [" + indexDir.getAbsolutePath() + "]");
460N/A throw new FileNotFoundException("Failed to create root directory [" + spellDir.getAbsolutePath() + "]");
270N/A interrupted = false;
270N/A //TODO we might need to add writer.commit after certain phases of index generation, right now it will only happen in the end
270N/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.");
320N/A log.warning("Failed to create file '" + timestamp.getAbsolutePath() + "', used for timestamping the index database.");
506N/A } catch (IOException e) {
207N/A } catch (IOException e) {
553N/A public void createSpellingSuggestions() {
553N/A } catch (IOException e) {
553N/A } catch (IOException e) {
310N/A } catch (IOException e) {
316N/A //below will only let go files and directories, anything else is considered special and is not added
320N/A if (isInterrupted()) {
207N/A String uid = Util.uid(path, DateTools.timeToString(file.lastModified(), DateTools.Resolution.MILLISECOND)); // construct uid for doc
207N/A removeFile();
207N/A interrupted = true;
207N/A private boolean isInterrupted() {
207N/A return interrupted;
274N/A } catch (IOException e) {
274N/A } 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;