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 {
|
try {
|
||||||
System.out.print(label+": ");
|
System.out.print(label+": ");
|
||||||
|
if (System.console() != null) {
|
||||||
|
ret = String.valueOf(System.console().readPassword());
|
||||||
|
}
|
||||||
|
else {
|
||||||
ret = stdin.readLine();
|
ret = stdin.readLine();
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user