Added method to read password from console
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -28,6 +28,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.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user