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));
}
}
|