class FSDirectory {
/** Closes the store to future operations. */
public synchronized void close() {
if (--refCount <= 0) {
synchronized (DIRECTORIES) {
DIRECTORIES.remove(directory);
}
}
}
}
class FSDirectory.FSIndexInput.Descriptor {
public void close() throws IOException {
if (isOpen) {
isOpen=false;
super.close();
}
}
}
class FSDirectory.FSIndexInput {
public void close() throws IOException {
// only close the file if this is not a clone
if (!isClone) file.close();
}
}
class FSDirectory.FSIndexOutput {
public void close() throws IOException {
// only close the file if it has not been closed yet
if (isOpen) {
super.close();
file.close();
isOpen = false;
}
}
}
|