FileDocCategorySizeDatePackage
FSDirectoryTestCase.javaAPI DocApache Lucene 1.4.3578Mon Jun 14 02:16:06 BST 2004org.apache.lucene.index.store

FSDirectoryTestCase.java

package org.apache.lucene.index.store;

import junit.framework.TestCase;
import org.apache.lucene.store.FSDirectory;
import java.io.IOException;

abstract public class FSDirectoryTestCase extends TestCase {
  private FSDirectory directory;

  protected final FSDirectory getDirectory() throws IOException {
    return getDirectory(false);
  }

  protected final FSDirectory getDirectory(boolean create) throws IOException {
    if (directory == null) {
      directory = FSDirectory.getDirectory(System.getProperty("test.index.dir"), create);
    }

    return directory;
  }
}