Indexing tooling via oak-run
Clean output directory at start
@@ -72,7 +72,7 @@ public class IndexCommand implements Command {
NodeStoreFixture fixture = NodeStoreFixtureProvider.create(opts);
try (Closer closer = Closer.create()) {
closer.register(fixture);
- cleanWorkDir(indexOpts.getWorkDir());
+ setupDirectories(indexOpts);
StatisticsProvider statisticsProvider = WhiteboardUtils.getService(fixture.getWhiteboard(), StatisticsProvider.class);
execute(fixture.getStore(), fixture.getBlobStore(), statisticsProvider, indexOpts, closer);
tellReportPaths();
@@ -158,6 +158,11 @@ public class IndexCommand implements Command {
}
}
+ private static void setupDirectories(IndexOptions indexOpts) throws IOException {
+ FileUtils.cleanDirectory(indexOpts.getOutDir());
+ cleanWorkDir(indexOpts.getWorkDir());
+ }
+
private static void cleanWorkDir(File workDir) throws IOException {
//TODO Do not clean if restarting
String[] dirListing = workDir.list();
