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.
|
|
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; InputStream inputStream = System.in; OutputStream outputStream = System.out;
public static void main(String[] args) { PasswordManager pm = new PasswordManager();
while (pm.running) { pm.showMenu(null, null); } System.exit(0); }
public PasswordManager() { try { outputStream.write("Hello World\n".getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { e.printStackTrace(); } }
@Override public void listVaults() {
}
@Override public void openVault() {
}
@Override public void showMenu(InputStream inputStream, OutputStream outputStream) { if (inputStream == null) { inputStream = this.inputStream; } if (outputStream == null) { outputStream = this.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; } } }
|