Skip to content

Commit 192ee6a

Browse files
committed
version 2.1.2
1 parent a51521f commit 192ee6a

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/main/java/com/simtechdata/App.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939

4040
public class App {
4141

42-
private static final String exeFolder = System.getProperty("user.dir");
43-
private static final Path outFile = Paths.get(exeFolder,"new_config.xml");
44-
private static final Path inFile = Paths.get(exeFolder, "config.xml");
45-
private static boolean isCheck = false;
46-
private static boolean debug = false;
47-
private static final String LF = System.getProperty("line.separator");
42+
private static final String EXE_FOLDER = System.getProperty("user.dir");
43+
private static final Path OUT_FILE = Paths.get(EXE_FOLDER, "new_config.xml");
44+
private static final Path IN_FILE = Paths.get(EXE_FOLDER, "config.xml");
45+
private static final String LF = System.getProperty("line.separator");
46+
private static boolean isCheck = false;
47+
private static boolean debug = false;
4848

4949

5050
public static void main(String[] args) {
@@ -59,11 +59,11 @@ public static void main(String[] args) {
5959
List<Subnet4> subnet4List = new ArrayList<>();
6060
String configXML = "";
6161
try {
62-
if (!inFile.toFile().exists()) {
62+
if (!IN_FILE.toFile().exists()) {
6363
System.out.println(Message.NO_CONFIG_FILE);
6464
System.exit(1);
6565
}
66-
configXML = Files.readString(inFile);
66+
configXML = Files.readString(IN_FILE);
6767
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
6868
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
6969
doc = dBuilder.parse(new InputSource(new StringReader(configXML)));
@@ -227,8 +227,8 @@ public static void main(String[] args) {
227227
transformer.transform(source, result);
228228
String pattern = "\\r?\\n\\s+\\r?\\n";
229229
String prettyXML = writer.toString().replaceAll(pattern, LF);
230-
outFile.toFile().createNewFile();
231-
Files.writeString(outFile, prettyXML, Charset.defaultCharset());
230+
OUT_FILE.toFile().createNewFile();
231+
Files.writeString(OUT_FILE, prettyXML, Charset.defaultCharset());
232232
System.out.println(Message.SUCCESS);
233233
System.exit(0);
234234
}
@@ -362,7 +362,6 @@ private static boolean validIPAddress(String ipAddress) {
362362
return ipValid;
363363
}
364364

365-
366365
/**
367366
* Handles the command line arguments when the program is first run
368367
*
@@ -393,7 +392,6 @@ private static void processArgs(String[] args) {
393392
}
394393
}
395394

396-
397395
/**
398396
* Generates one UUID for each Kea static mapping
399397
*
@@ -521,6 +519,4 @@ private static void howTo() {
521519
System.out.println(Message.HOW_TO);
522520
System.exit(0);
523521
}
524-
525-
526522
}

0 commit comments

Comments
 (0)