FileDocCategorySizeDatePackage
AbstractBenchmarker.javaAPI DocApache Lucene 2.1.01753Wed Feb 14 10:46:16 GMT 2007org.apache.lucene.benchmark

AbstractBenchmarker

public abstract class AbstractBenchmarker extends Object implements Benchmarker

Fields Summary
Constructors Summary
Methods Summary
public static booleanfullyDelete(java.io.File dir)
Delete files and directories, even if non-empty.

param
dir file or directory
return
true on success, false if no or part of files have been deleted
throws
java.io.IOException

        if (dir == null || !dir.exists()) return false;
        File contents[] = dir.listFiles();
        if (contents != null)
        {
            for (int i = 0; i < contents.length; i++)
            {
                if (contents[i].isFile())
                {
                    if (!contents[i].delete())
                    {
                        return false;
                    }
                }
                else
                {
                    if (!fullyDelete(contents[i]))
                    {
                        return false;
                    }
                }
            }
        }
        return dir.delete();