code: public String readMaskedText(String prompt) {
          if (!isInputStreamAvailable()) {
              stderr.println(CommandUtils.getCMessage("error.inputConsoleNotAvailable"));
              return null;
          }
          try {
              char[] in = console.readPassword(prompt);
              if (in == null) {
                  return null;
              } else {
                  return String.valueOf(in);
              }
          } catch (IOError e) {
              stderr.println("Exception while reading stdin: " + e.getMessage());
              e.printStackTrace(stderr);
          }
          return null;
      }
docs: Reads text from the input String, prompting with the given String.
  The values entered on the console are masked (not echoed back to
  the console).
  
  @param prompt
  @return String read from input.