ARTEMIS-991 handle odd password input
(cherry picked from commit ef8f992ca2
)
This commit is contained in:
parent
4ddd969ffc
commit
1f054f04a0
|
@ -63,13 +63,21 @@ public class InputAbstract extends ActionAbstract {
|
||||||
return silentDefault;
|
return silentDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
String inputStr;
|
String inputStr = "";
|
||||||
boolean valid = false;
|
boolean valid = false;
|
||||||
System.out.println();
|
System.out.println();
|
||||||
do {
|
do {
|
||||||
context.out.println(propertyName + ": is mandatory with this configuration:");
|
context.out.println(propertyName + ": is mandatory with this configuration:");
|
||||||
context.out.println(prompt);
|
context.out.println(prompt);
|
||||||
inputStr = new String(System.console().readPassword());
|
char[] chars = System.console().readPassword();
|
||||||
|
|
||||||
|
// could be null if the user input something weird like Ctrl-d
|
||||||
|
if (chars == null) {
|
||||||
|
System.out.println("Invalid Entry!");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputStr = new String(chars);
|
||||||
|
|
||||||
if (inputStr.trim().equals("")) {
|
if (inputStr.trim().equals("")) {
|
||||||
System.out.println("Invalid Entry!");
|
System.out.println("Invalid Entry!");
|
||||||
|
|
Loading…
Reference in New Issue