| | |
| | | Message defaultValue, |
| | | Message[] validValues) { |
| | | |
| | | printLineBreak(); |
| | | |
| | | boolean isValid = false; |
| | | Message response = null; |
| | | while (!isValid) |
| | |
| | | * @return The string value read from the user. |
| | | */ |
| | | protected String promptForString(Message prompt, String defaultValue) { |
| | | printLineBreak(); |
| | | String wrappedPrompt = StaticUtils.wrapText(prompt, |
| | | Utils.getCommandLineMaxLineWidth()); |
| | | |
| | |
| | | protected String promptForPassword(Message msg) |
| | | { |
| | | String pwd; |
| | | printLineBreak(); |
| | | String wrappedPrompt = StaticUtils.wrapText(msg, |
| | | Utils.getCommandLineMaxLineWidth()); |
| | | out.print(wrappedPrompt+" "); |
| | |
| | | { |
| | | pwd = new String(pwChars); |
| | | } |
| | | // Sometimes the backspace trick creates problems in the terminal and |
| | | // out.println() does not write a new line. printing a space fixes the |
| | | // problem |
| | | out.print(" "); |
| | | out.flush(); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | err.println(); |
| | | Message msg = Utils.getThrowableMsg(INFO_ERROR_CONNECTING_TO_LOCAL.get(), |
| | | t); |
| | | printErrorMessage(msg); |
| | |
| | | } |
| | | if (displayErrorMessage) |
| | | { |
| | | printLineBreak(); |
| | | printErrorMessage(msg); |
| | | } |
| | | Message[] validValues = { |