Added method to read password from console

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-04-18 19:36:41 +02:00
parent f3db915fdc
commit 833a35c6f2

View File

@ -28,6 +28,18 @@ public class FormUtil {
return ret;
}
/**
* Reads a password from the console.
*
* @return the entered password
*/
static String readPassword() {
String password;
System.out.print("Password: ");
password = String.valueOf(System.console().readPassword());
return password;
}
/**
* Reads an integer from the console.
*