ARTEMIS-912 Fix file configuration migration tool

This commit is contained in:
Martyn Taylor 2017-01-09 14:48:28 +00:00 committed by Justin Bertram
parent ef4efe7d3f
commit 63cf4d5a60
1 changed files with 18 additions and 19 deletions

View File

@ -29,7 +29,7 @@ public class Main {
File input = new File(args[0]);
if (input.isDirectory()) {
System.out.println("Scanning directory: " + input.getAbsolutePath());
recursiveTransform(input);
scanAndTransform(input);
} else {
if (args.length != 2) {
System.err.println("Invalid args");
@ -37,6 +37,7 @@ public class Main {
} else {
try {
XMLConfigurationMigration migration = new XMLConfigurationMigration(input, new File(args[1]));
migration.transform();
} catch (Exception e) {
// Unable to process file, move on.
}
@ -51,11 +52,10 @@ public class Main {
}
}
public static void scanAndTransform(File pFile) throws Exception {
public static void scanAndTransform(File f) throws Exception {
try {
for (File f : pFile.listFiles()) {
if (f.isDirectory()) {
scanAndTransform(f);
recursiveTransform(f);
} else {
try {
if (f.getName().endsWith("xml")) {
@ -72,9 +72,8 @@ public class Main {
//Unable to process file, continue
}
}
}
} catch (NullPointerException e) {
System.out.println(pFile.getAbsoluteFile());
System.out.println(f.getAbsoluteFile());
}
}