private static int getChoiceNumber(File[] foundBudgets) { String toCheck = Listener.getInput(); int highestChoice = foundBudgets.length; while (InputValidator.inputNotABudget(toCheck, highestChoice)) toCheck = Listener.getInput(); if (!(toCheck.equals("exit"))) return (Integer.valueOf(toCheck) - 1); else return -5; }
public static void getLoadDirectory() { AnsiConsole.out.println(ansi().eraseScreen()); Printer.print("savedInDefault"); System.out.println(BudgetBoss.getDefaultDirectory()); Printer.print("whereSaved"); String toCheck = Listener.getInput(); while (InputValidator.pathIsInvalid(toCheck)) toCheck = Listener.getInput(); if (!(toCheck.equals("exit"))) { if (toCheck.equalsIgnoreCase("y")) { searchDirectory(BudgetBoss.getDefaultDirectory()); } else searchDirectory(toCheck); } }