Uses secure password prompt if possible

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-05-01 16:32:49 +02:00
parent 8a513bf892
commit 2deebe0bff

View File

@ -41,7 +41,12 @@ public class FormUtil {
try {
System.out.print(label+": ");
ret = stdin.readLine();
if (System.console() != null) {
ret = String.valueOf(System.console().readPassword());
}
else {
ret = stdin.readLine();
}
} catch (IOException e) {
e.printStackTrace();
}