You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.4 KiB

  1. import java.io.IOException;
  2. import java.io.InputStream;
  3. import java.io.OutputStream;
  4. import java.nio.charset.StandardCharsets;
  5. import java.util.Scanner;
  6. public class Vault implements VaultInterface {
  7. public boolean config;
  8. public int PWLength;
  9. InputStream inputS = System.in;
  10. OutputStream outputS = System.out;
  11. private void println(String output) {
  12. try {
  13. outputS.write((output + "\n").getBytes(StandardCharsets.UTF_8));
  14. } catch (IOException e) {
  15. e.printStackTrace();
  16. }
  17. }
  18. public void configure(){
  19. StringBuilder sbcm = new StringBuilder();
  20. Scanner scan = new Scanner(inputS);
  21. config = true;
  22. sbcm.append("Configure:\n");
  23. sbcm.append("- Password length: l\n");
  24. sbcm.append("- Have Capitals: h\n");
  25. sbcm.append("- exit: e\n");
  26. println(sbcm.toString());
  27. String input = scan.nextLine();
  28. if (input.equals("e")) {
  29. config = false;
  30. }
  31. }
  32. public void setPWLength(){
  33. println("Set PW length:");
  34. Scanner scan = new Scanner(inputS);
  35. String input = scan.nextLine();
  36. PWLength = Integer.parseInt(input);
  37. println("\nNew PWlength is now: ");
  38. }
  39. public void addCredential(){
  40. }
  41. public void showCredential(){
  42. }
  43. public void getAsJson(){
  44. }
  45. public void loadFromJson(){
  46. }
  47. }