import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.util.Scanner; public class Vault implements VaultInterface { public boolean config; public int PWLength; public boolean haveCapitals = false; InputStream inputS = System.in; OutputStream outputS = System.out; private void println(String output) { try { outputS.write((output + "\n").getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { e.printStackTrace(); } } public void configure(){ StringBuilder sbcm = new StringBuilder(); Scanner scan = new Scanner(inputS); config = true; sbcm.append("Configure:\n"); sbcm.append("- Password length: l\n"); sbcm.append("- Have Capitals: h\n"); sbcm.append("- exit: e\n"); println(sbcm.toString()); String input = scan.nextLine(); if (input.equals("e")) { config = false; } } public void setPWLength(){ println("Set PW length:"); Scanner scan = new Scanner(inputS); String input = scan.nextLine(); try { PWLength = Integer.parseInt(input); } catch (NumberFormatException e) { println("Please Enter Valid Number."); } println("\nNew PWlength is now: "); } public void addCredential(){ } public void showCredential(){ } public void getAsJson(){ } public void loadFromJson(){ } public void setCapital() { println("Should you PW have Capitals? Type in yes or no."); Scanner scan = new Scanner(inputS); String input = scan.nextLine(); if(input.equals("yes")){ haveCapitals = true; println("Your PWs contain now capitals."); }else if(input.equals("no")){ haveCapitals = false; println("Your PWs donĀ“t have capitals anymore."); } } }