Skip to content

Commit

Permalink
write only once after apply of all preconfigs
Browse files Browse the repository at this point in the history
  • Loading branch information
iitsoftware committed Feb 16, 2023
1 parent 8e10d2a commit 62dcf9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/swiftmq/preconfig/Processor.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public class Processor {
private static void checkAndApplyPreconfig(String preconfig, String configFilename) throws Exception {
Document routerConfig = XMLUtilities.createDocument(new FileInputStream(configFilename));
if (preconfig != null && preconfig.trim().length() > 0) {
XMLUtilities.writeDocument(routerConfig, configFilename + fmt.format(new Date()));
StringTokenizer t = new StringTokenizer(preconfig, ",");
while (t.hasMoreTokens()) {
String pc = t.nextToken();
XMLUtilities.writeDocument(routerConfig, configFilename + fmt.format(new Date()));
routerConfig = new PreConfigurator(routerConfig, XMLUtilities.createDocument(new FileInputStream(pc))).applyChanges();
XMLUtilities.writeDocument(routerConfig, configFilename);
System.out.println("Applied changes from preconfig file: " + pc);
}
XMLUtilities.writeDocument(routerConfig, configFilename);
}
}

Expand Down

0 comments on commit 62dcf9d

Please sign in to comment.