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.
58 lines
1.3 KiB
58 lines
1.3 KiB
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.util.Scanner;
|
|
|
|
public class PasswordManager implements PasswordManagerInterface {
|
|
|
|
boolean running = true;
|
|
|
|
public static void main(String[] args) {
|
|
PasswordManager pm = new PasswordManager();
|
|
InputStream inputStream = System.in;
|
|
OutputStream outputStream = System.out;
|
|
|
|
while (pm.running) {
|
|
pm.showMenu(inputStream, outputStream);
|
|
}
|
|
System.exit(0);
|
|
}
|
|
|
|
public PasswordManager() {
|
|
System.out.println("Hello World");
|
|
}
|
|
|
|
@Override
|
|
public void listVaults() {
|
|
}
|
|
|
|
@Override
|
|
public void openVault() {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void showMenu(InputStream inputStream, OutputStream outputStream) {
|
|
StringBuilder sb = new StringBuilder();
|
|
Scanner scan = new Scanner(inputStream);
|
|
running = true;
|
|
|
|
sb.append("ciip Gruppe 8 - Password Manager\n\n");
|
|
|
|
sb.append("Menu:\n");
|
|
sb.append("- exit: e\n");
|
|
|
|
try {
|
|
outputStream.write((sb + "\n").getBytes(StandardCharsets.UTF_8));
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
|
|
String input = scan.nextLine();
|
|
|
|
if (input.equals("e")) {
|
|
running = false;
|
|
}
|
|
}
|
|
}
|