Package jline.console

Examples of jline.console.ConsoleReader.readLine()


   private static String readEnter(String msg, PromptType promptType) throws Exception {
      String enter = "";
      ConsoleReader reader = new ConsoleReader();
      reader.setPrompt(msg);
      if (promptType == PromptType.USER_NAME) {
         enter = reader.readLine();
      } else if (promptType == PromptType.PASSWORD) {
         enter = reader.readLine(Character.valueOf('*'));
      }
      return enter;
   }
View Full Code Here


      ConsoleReader reader = new ConsoleReader();
      reader.setPrompt(msg);
      if (promptType == PromptType.USER_NAME) {
         enter = reader.readLine();
      } else if (promptType == PromptType.PASSWORD) {
         enter = reader.readLine(Character.valueOf('*'));
      }
      return enter;
   }
}
View Full Code Here

               // Set prompt message
               reader.setPrompt(Constants.PARAM_PROMPT_ADD_CERTIFICATE_MESSAGE);
               // Read user input
               String readMsg = "";
               if (RunWayConfig.getRunType().equals(RunType.MANUAL)) {
                  readMsg = reader.readLine();
               } else {
                  readMsg = "yes";
               }
               if (!"yes".equalsIgnoreCase(readMsg.trim())
                     && !"y".equalsIgnoreCase(readMsg.trim())) {
View Full Code Here

      try {
         ConsoleReader reader = new ConsoleReader();
         reader.setPrompt(promptMsg);
         String password = null;
         try {
            password = reader.readLine(Character.valueOf('*'));
         } catch (IllegalArgumentException e) {
            if (e.getMessage().contains("!")) {
               CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
                     null, Constants.OUTPUT_OP_CREATE,
                     Constants.OUTPUT_OP_RESULT_FAIL,
View Full Code Here

      ConsoleReader reader = new ConsoleReader();
      for (Credential credential : authenticationClient.getRequiredCredentials()) {
        String prompt = "Please, specify " + credential.getDescription() + "> ";
        String credentialValue;
        if (credential.isSecret()) {
          credentialValue = reader.readLine(prompt, '*');
        } else {
          credentialValue = reader.readLine(prompt);
        }
        properties.put(credential.getName(), credentialValue);
      }
View Full Code Here

        String prompt = "Please, specify " + credential.getDescription() + "> ";
        String credentialValue;
        if (credential.isSecret()) {
          credentialValue = reader.readLine(prompt, '*');
        } else {
          credentialValue = reader.readLine(prompt);
        }
        properties.put(credential.getName(), credentialValue);
      }
      authenticationClient.configure(properties);
      cliConfig.getClientConfig().setAuthenticationClient(authenticationClient);
View Full Code Here

            ? new Character((char) 0)
            : new Character(args[0].charAt(0));

        String line;
        do {
            line = reader.readLine("Enter password> ", mask);
            System.out.println("Got password: " + line);
        }
        while (line != null && line.length() > 0);
    }
}
View Full Code Here

            }

            String line;
            PrintWriter out = new PrintWriter(reader.getOutput());

            while ((line = reader.readLine()) != null) {
                if (color){
                    out.println("\u001B[33m======>\u001B[0m\"" + line + "\"");

                } else {
                    out.println("======>\"" + line + "\"");
View Full Code Here

                out.flush();

                // If we input the special word then we will mask
                // the next line.
                if ((trigger != null) && (line.compareTo(trigger) == 0)) {
                    line = reader.readLine("password> ", mask);
                }
                if (line.equalsIgnoreCase("quit") || line.equalsIgnoreCase("exit")) {
                    break;
                }
                if (line.equalsIgnoreCase("cls")) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.