FileDocCategorySizeDatePackage
_TestUtil.javaAPI DocApache Lucene 2.1.0516Wed Feb 14 10:46:36 GMT 2007org.apache.lucene.util

_TestUtil.java

package org.apache.lucene.util;
import java.io.File;
import java.io.IOException;

public class _TestUtil {

  public static void rmDir(File dir) throws IOException {
    if (dir.exists()) {
      File[] files = dir.listFiles();
      for (int i = 0; i < files.length; i++) {
        if (!files[i].delete()) {
          throw new IOException("could not delete " + files[i]);
        }
      }
      dir.delete();
    }
  }

  public static void rmDir(String dir) throws IOException {
    rmDir(new File(dir));
  }
}