Added method to read password from console
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
parent
650f75dd14
commit
665d551b77
|
@ -27,6 +27,18 @@ public class FormUtil {
|
||||||
|
|
||||||
return ret;
|
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.
|
* Reads an integer from the console.
|
||||||
|
|
Loading…
Reference in New Issue