mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-09 07:24:41 +00:00
[HER-1641] migration tool to convert Heritrix 1.14.x order.xml to H3 crawler-beans.cxml
* MigrateH1to3Tool.java
add count of successfully migrated settings
This commit is contained in:
1 parent
9b3a65ab3a
commit
f960a018c1
1 file changed
+6
@@ -100,6 +100,7 @@ public class MigrateH1to3Tool {
|
||||
|
||||
List<String> notApplicable = new ArrayList<String>();
|
||||
List<String> needsAttention = new ArrayList<String>();
|
||||
int migrated = 0;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(String key : h1simpleSettings.keySet()) {
|
||||
String beanPath = migrateH1toH3Map.get(key);
|
||||
@@ -112,6 +113,7 @@ public class MigrateH1to3Tool {
|
||||
// TODO: needs special handling
|
||||
if(beanPath.equals("*metadata.userAgentTemplate")) {
|
||||
splitH1userAgent(value,sb);
|
||||
migrated += 2;
|
||||
} else {
|
||||
needsAttention.add(key+" "+value);
|
||||
}
|
||||
@@ -121,6 +123,8 @@ public class MigrateH1to3Tool {
|
||||
.append("=")
|
||||
.append(value)
|
||||
.append("\n");
|
||||
migrated++;
|
||||
|
||||
}
|
||||
System.out.print(".");
|
||||
}
|
||||
@@ -148,6 +152,8 @@ public class MigrateH1to3Tool {
|
||||
System.out.println("of the following and update manually to reflect your intent ");
|
||||
listProblems(needsAttention);
|
||||
System.out.println();
|
||||
System.out.println(migrated +" H1 settings successfully migrated to H3 configuration");
|
||||
System.out.println();
|
||||
System.out.println("Review your converted crawler-beans.cxml at:");
|
||||
System.out.println(targetBeansXmlFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user