From 659493c0900b7c3e220d1de3c80ddabda36edc6b Mon Sep 17 00:00:00 2001 From: Keith Armstrong Date: Thu, 2 Jan 2025 18:20:24 -0500 Subject: [PATCH] Cleaned up the code in a couple of files --- src/com/belkast/soap/userVerify.java | 2 +- src/com/belkast/soap/webService.java | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/com/belkast/soap/userVerify.java b/src/com/belkast/soap/userVerify.java index e084f11..0815f97 100644 --- a/src/com/belkast/soap/userVerify.java +++ b/src/com/belkast/soap/userVerify.java @@ -36,7 +36,7 @@ public class userVerify valueMap.put("n", false); while (true) { - System.out.print("Block on empty column values (Y/n) : "); + System.out.print("Invalidate the line if empty column value (Y/n) : "); String varAnswer = myObj.nextLine(); // Read user input if (varAnswer.toUpperCase().equals("Y") || varAnswer.toUpperCase().equals("N") || varAnswer == "") diff --git a/src/com/belkast/soap/webService.java b/src/com/belkast/soap/webService.java index 8f26615..ddb773f 100644 --- a/src/com/belkast/soap/webService.java +++ b/src/com/belkast/soap/webService.java @@ -42,8 +42,6 @@ public class webService { System.exit(0); } - System.out.println(); - varDebug = Boolean.valueOf(args.debug); varKey = args.key; String varToEncrypt = args.encrypt; @@ -72,7 +70,8 @@ public class webService { if (!fileProcessor.getFile(varProps) || !fileProcessor.validFile(varProps)) { - debugProcessor.writer(true, "Something went wrong. Please check that the properties file is correctly formatted!"); + debugProcessor.writer(true, "Please check that the properties file " + varProps + " is correctly formatted!"); + System.out.println(); System.exit(0); } @@ -81,7 +80,9 @@ public class webService { doSoap(new File(varProps)); } + System.out.println(); System.exit(0); + } private static void doSoap(File thisProps) throws Exception { @@ -106,18 +107,21 @@ public class webService { File checkInput = new File(varInputFile); if (!checkInput.exists()) { debugProcessor.writer(true, thisProps + " => The file specified in XML_FILE does not exist [ " + varInputFile + " ]"); + System.out.println(); System.exit(0); } File checkRole = new File(varRoleFile); if (!checkRole.exists()) { debugProcessor.writer(true, thisProps + " => The file specified in CSV_FILE does not exist [ " + varRoleFile + " ]"); + System.out.println(); System.exit(0); } } catch (Exception e) { - debugProcessor.writer(true, thisProps + " => Something went wrong. Please check that the properties file is correctly formatted!"); + debugProcessor.writer(true, "Please check that the properties file " + thisProps + " is correctly formatted!"); + System.out.println(); System.exit(0); } @@ -126,10 +130,11 @@ public class webService { } catch (Exception e) { debugProcessor.writer(true, "The password could not be decrypted. Please check that the Encryption Key is correct!"); + System.out.println(); System.exit(0); } - System.out.println(); + debugProcessor.writer(varDebug, ""); debugProcessor.writer(varDebug, thisProps + " => SOAP URL : " + varURL); debugProcessor.writer(varDebug, thisProps + " => Username : " + varUsername); debugProcessor.writer(varDebug, thisProps + " => Use SSL : " + varUseSSL); @@ -142,8 +147,8 @@ public class webService { ArrayList thisCSV = userVerify.readCSV(varRoleFile, false, !varEmptyColumns); boolean validfile = (!thisCSV.isEmpty()); - debugProcessor.writer(true, varRoleFile + " => CSV file is valid : " + validfile); - debugProcessor.writer(true, varRoleFile + " => records to process : " + thisCSV.size()); + debugProcessor.writer(true, varRoleFile + " => CSV file is valid : " + validfile); + debugProcessor.writer(true, varRoleFile + " => records to process : " + thisCSV.size()); if (!validfile) { @@ -153,7 +158,7 @@ public class webService { Iterator mapper1 = thisCSV.iterator(); while (mapper1.hasNext()) { varCount++; - debugProcessor.writer(false, ""); + debugProcessor.writer(true, ""); debugProcessor.writer(true, "processing record " + varCount); Map hashMap = mapper1.next();