/**
  * Closes the writer to be sure that all changes are in the directory and then calls the shell
  * command that makes a copy of it. Used to make a copy of the directory while it's in a
  * consistent state. If there is an index optimization scheduled, it'll be performed here.
  *
  * @throws IllegasStateException if the index copy couldn't be made.
  * @throws RuntimeException if there was a problem opening the index.
  */
 public synchronized void makeDirectoryCheckpoint() {
   workIndex.flush();
 }
 /**
  * Opens the writer.
  *
  * @throws RuntTimeException if there was a problem opening the writer.
  */
 private void openWriter() {
   writer = workIndex.getLuceneIndexWriter();
 }