1
package org.apache.lucene.benchmark;
4
import java.io.IOException;
6
* Copyright 2005 The Apache Software Foundation
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
24
* @deprecated Use the Task based benchmarker
26
public abstract class AbstractBenchmarker implements Benchmarker
29
* Delete files and directories, even if non-empty.
31
* @param dir file or directory
32
* @return true on success, false if no or part of files have been deleted
33
* @throws java.io.IOException
35
public static boolean fullyDelete(File dir) throws IOException
37
if (dir == null || !dir.exists()) return false;
38
File contents[] = dir.listFiles();
41
for (int i = 0; i < contents.length; i++)
43
if (contents[i].isFile())
45
if (!contents[i].delete())
52
if (!fullyDelete(contents[i]))