IndexDatabase.java revision 439
98N/A * See LICENSE.txt included in this distribution for the specific
919N/A * file and include the License file at LICENSE.txt.
public class IndexDatabase {
private boolean interrupted;
private boolean dirty;
private boolean running;
initialize();
initialize();
public void run() {
} catch (Exception e) {
public void run() {
} catch (Exception e) {
throw new FileNotFoundException("Failed to create root directory [" + indexDir.getAbsolutePath() + "]");
throw new FileNotFoundException("Failed to create root directory [" + spellDir.getAbsolutePath() + "]");
synchronized (lock) {
if (running) {
running = true;
interrupted = false;
while (uidIter.term() != null && uidIter.term().field().equals("u") && uidIter.term().text().startsWith(startuid)) {
removeFile();
} catch (IOException e) {
} catch (IOException e) {
synchronized (lock) {
running = false;
optimize();
public void run() {
} catch (Exception e) {
public void run() {
} catch (Exception e) {
public void optimize() {
synchronized (lock) {
if (running) {
running = true;
synchronized (lock) {
dirty = false;
} catch (IOException e) {
} catch (IOException e) {
synchronized (lock) {
running = false;
public void createSpellingSuggestions() {
} catch (IOException e) {
} catch (IOException e) {
private boolean isDirty() {
synchronized (lock) {
return dirty;
private void setDirty() {
synchronized (lock) {
if (!dirty) {
dirty = true;
} catch (IOException e) {
setDirty();
if (d != null) {
setDirty();
if (isInterrupted()) {
String uid = Util.uid(path, DateTools.timeToString(file.lastModified(), DateTools.Resolution.MILLISECOND)); // construct uid for doc
removeFile();
public void interrupt() {
synchronized (lock) {
interrupted = true;
private boolean isInterrupted() {
synchronized (lock) {
return interrupted;
} catch (Exception e) {
} catch (Exception e) {
} catch (Exception e) {
} catch (Exception 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;