Just a general code cleanup

This commit is contained in:
Keith Armstrong 2025-01-16 07:48:04 -05:00
parent f20c999933
commit 2a233bc5d3
4 changed files with 14 additions and 15 deletions

View File

@ -16,7 +16,7 @@ public class fileProcessor {
public static String readFirstLine(String thisFile) throws IOException { public static String readFirstLine(String thisFile) throws IOException {
File file = new File(thisFile); File file = new File(thisFile);
Boolean isValid = validFile(thisFile); boolean isValid = validFile(thisFile);
if ( !isValid ) if ( !isValid )
{ {

View File

@ -2,13 +2,8 @@ package com.belkast.soap;
import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameter;
import java.util.ArrayList; public class jCommanderArgs
import java.util.List; {
public class jCommanderArgs {
@Parameter
private List<String> parameters = new ArrayList<>();
@Parameter(names = "--props" , description = "Location of the properties file", validateWith = jCommanderVerifyFile.class) @Parameter(names = "--props" , description = "Location of the properties file", validateWith = jCommanderVerifyFile.class)
public String props; public String props;

View File

@ -19,6 +19,10 @@ public class propertyProcessor
{ {
propertyValue = thisDefault; propertyValue = thisDefault;
} }
else
{
propertyValue = propertyValue.trim();
}
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -23,7 +23,7 @@ public class userVerify
System.out.print(varPrompt); System.out.print(varPrompt);
varFileName = myObj.nextLine(); varFileName = myObj.nextLine();
File thisFile = new File(varFileName); File thisFile = new File(varFileName);
Boolean isValidFile = fileProcessor.validFile(varFileName); boolean isValidFile = fileProcessor.validFile(varFileName);
if ( thisFile.exists() && isValidFile ) if ( thisFile.exists() && isValidFile )
{ {
break; break;
@ -31,7 +31,7 @@ public class userVerify
varPrompt = "\nThe CSV file does not exist or cannot be read!\nPlease enter the name of the CSV file to validate : "; varPrompt = "\nThe CSV file does not exist or cannot be read!\nPlease enter the name of the CSV file to validate : ";
} }
Boolean varUserBlockEmpty = false; boolean varUserBlockEmpty = false;
HashMap<String, Boolean> valueMap = new HashMap(); HashMap<String, Boolean> valueMap = new HashMap();
valueMap.put("Y", true); valueMap.put("Y", true);
@ -73,9 +73,9 @@ public class userVerify
} }
debugProcessor.writer(true, ""); debugProcessor.writer(true, "");
} }
boolean validfile = (!thisCSV.isEmpty()); boolean validFile = (!thisCSV.isEmpty());
debugProcessor.writer(true, "CSV file records : " + varIter); debugProcessor.writer(true, "CSV file records : " + varIter);
debugProcessor.writer(true, "CSV file is valid : " + validfile); debugProcessor.writer(true, "CSV file is valid : " + validFile);
System.out.println(); System.out.println();
} }
@ -92,8 +92,8 @@ public class userVerify
} }
String exceptionReason = null; String exceptionReason = null;
Boolean failedOnException = false; boolean failedOnException = false;
Boolean parsedCorrectly = false; boolean parsedCorrectly = false;
long lineNum = 0; long lineNum = 0;
while (!parsedCorrectly && !failedOnException) { while (!parsedCorrectly && !failedOnException) {
@ -133,7 +133,7 @@ public class userVerify
boolean isValid = record.isConsistent(); boolean isValid = record.isConsistent();
int thisSize = record.size(); int thisSize = record.size();
String thisLine = Files.readAllLines(Paths.get(thisFile)).get(Math.toIntExact(lineNum - 1)); String thisLine = Files.readAllLines(Paths.get(thisFile)).get(Math.toIntExact(lineNum - 1));
Boolean validValues = true; boolean validValues = true;
if (isValid) if (isValid)
{ {