Cleaned up the code in a couple of files

This commit is contained in:
Keith Armstrong 2025-01-02 18:20:24 -05:00
parent 383eaa5cd3
commit 659493c090
2 changed files with 14 additions and 9 deletions

View File

@ -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 == "")

View File

@ -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<Map> mapper1 = thisCSV.iterator();
while (mapper1.hasNext()) {
varCount++;
debugProcessor.writer(false, "");
debugProcessor.writer(true, "");
debugProcessor.writer(true, "processing record " + varCount);
Map hashMap = mapper1.next();