Uses secure password prompt if possible
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -41,7 +41,12 @@ public class FormUtil {
|
||||
|
||||
try {
|
||||
System.out.print(label+": ");
|
||||
if (System.console() != null) {
|
||||
ret = String.valueOf(System.console().readPassword());
|
||||
}
|
||||
else {
|
||||
ret = stdin.readLine();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user