Package java.io

Examples of java.io.Console.readPassword()


            return(null);
         
          if (!StringUtils.isEmpty(getVerifyPrompt()))
            System.err.print(getVerifyPrompt() + ": ");
           
          char[] verifyPassword = console.readPassword();
         
          passwordsAreTheSame = Arrays.equals(password, verifyPassword);
          if (!passwordsAreTheSame && !StringUtils.isEmpty(getVerifyErrorMessage()))
            System.err.println(getVerifyErrorMessage());
        }
View Full Code Here


      else
      {
        if (!StringUtils.isEmpty(getPasswordPrompt()))
           System.err.print(getPasswordPrompt() + ": ");
       
        password = console.readPassword();
      }
    }
     
    //If the user just presses ENTER regard as a cancel
    if (password != null && password.length == 0)
View Full Code Here

            if (console == null) {
              throw new ParameterException("No console is available to get parameter "
                  + pd.getNames()[0]);
            }
            System.out.print("Value for " + pd.getNames()[0] + " (" + pd.getDescription() + "):");
            char[] password = console.readPassword();
            pd.addValue(new String(password));
          } else {
            Class<?> fieldType = pd.getField().getType();
            if ((fieldType == boolean.class || fieldType == Boolean.class)
                && pd.getParameter().arity() == -1) {
View Full Code Here

        }

        if (must_auth) {
            if (cons != null) {
                username = cons.readLine("Management username: ");
                password = String.valueOf(cons.readPassword("Management password: "));
            }
        }
        SosInterpreter interpreter = new SosInterpreter();
        return interpreter.collect(username, password, host, port);
    }
View Full Code Here

            Console console = System.console();
            if (console == null) {
              throw new ParameterException("No console is available to get parameter " + a);
            }
            System.out.print("Value for " + a + " (" + pd.getDescription() + "):");
            char[] password = console.readPassword();
            pd.addValue(new String(password));
          } else {
            //
            // Regular option
            //
View Full Code Here

            Console console = System.console();
            if (console == null) {
              throw new ParameterException("No console is available to get parameter " + a);
            }
            System.out.print("Value for " + a + " (" + pd.getDescription() + "):");
            char[] password = console.readPassword();
            pd.addValue(new String(password));
          } else {
            //
            // Regular option
            //
View Full Code Here

      System.err.println("Error: No Console");
      return null;
    }

    while (true) {
      char[] pw1 = console.readPassword("  Type Password: ");
      if ((pw1 == null) || (pw1.length == 0)) {
        System.exit(0);
      }
      char[] pw2 = console.readPassword("Retype Password: ");
      if (Arrays.equals(pw1, pw2)) {
View Full Code Here

    while (true) {
      char[] pw1 = console.readPassword("  Type Password: ");
      if ((pw1 == null) || (pw1.length == 0)) {
        System.exit(0);
      }
      char[] pw2 = console.readPassword("Retype Password: ");
      if (Arrays.equals(pw1, pw2)) {
        System.out.println("\nThe encrypted password is:");
        Arrays.fill(pw2, '\0');
        return pw1;
      }
View Full Code Here

    }

    protected String readPassword(String prompt) {
        Console console = System.console();
        System.out.print(prompt);
        char[] pw = console.readPassword();
        return new String(pw);
    }

    protected void configureRequirements(ProjectRequirements requirements) throws MojoExecutionException {
        if (Strings.isNotBlank(profile)) {
View Full Code Here

    }

    protected String readPassword(String prompt) {
        Console console = System.console();
        System.out.print(prompt);
        char[] pw = console.readPassword();
        return new String(pw);
    }

    @SuppressWarnings("unchecked")
    protected void uploadAppZip(boolean newUserAdded) throws Exception {
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.