code: public String promptForPassword(String arg) {
  
  		char[] pass1 = console.readPassword(CommandUtils.getMessage("password.enterText", arg) + " ");		
  		char[] pass2 = console.readPassword(CommandUtils.getMessage("password.reenterText", arg) + " ");
  		
  		if (pass1 == null && pass2 == null) {
              throw new IllegalArgumentException("Unable to read either entry. Aborting prompt.");
          }
  		if (pass1 == null || pass2 == null) {
              stdout.println(CommandUtils.getMessage("password.readError"));
              return promptForPassword(arg);
          }
  				
  		String password1 =  String.valueOf(pass1);
  		String password2 =  String.valueOf(pass2);
  		
         if (password1.equals(password2)) {
              return password1;
          } else {
              stdout.println(CommandUtils.getMessage("password.entriesDidNotMatch"));
              return promptForPassword(arg);
          }		
  	}
docs: Prompt the user to enter text. Prompts
  twice and compares to ensure it was entered correctly.
  
  @return Entered String