Package java.io

Examples of java.io.Console.readLine()


        Console con = System.console();
        FootballManager manager = new FootballManager(System.console());
        con.printf(initialPrompt);

        while (true) {
            String action = con.readLine(">");
            if ("at".equals(action)) {
                manager.addTeam();
            } else if ("ap".equals(action)) {
                manager.addPlayers();
            } else if ("rt".equals(action)) {
View Full Code Here


        Console con = System.console();
        FootballManager manager = new FootballManager(System.console());
        con.printf(initialPrompt);

        while (true) {
            String action = con.readLine(">");
            if ("at".equals(action)) {
                manager.addTeam();
            } else if ("ap".equals(action)) {
                manager.addPlayers();
            } else if ("rt".equals(action)) {
View Full Code Here

        Console con = System.console();
        FootballManager manager = new FootballManager(System.console());
        con.printf(initialPrompt);

        while (true) {
            String action = con.readLine(">");
            if ("at".equals(action)) {
                manager.addTeam();
            } else if ("ap".equals(action)) {
                manager.addPlayers();
            } else if ("rt".equals(action)) {
View Full Code Here

 
  @Override
  public boolean promptUsername(String message) {
    final Console console = System.console();
    showHeader(console);
    username = console.readLine("# %s: ", message);
    return username.length() > 0;   
 

  @Override
  public boolean promptYesNo(String message) {
View Full Code Here

    final Console console = System.console();
    showHeader(console);
   
    String line;
    while (true) {
      line = console.readLine("# %s [yes/no]: ", message);
      if ("yes".equalsIgnoreCase(line) || "y".equalsIgnoreCase(line)) {
        return true;
      }
      if ("no".equalsIgnoreCase(line) || "n".equalsIgnoreCase(line)) {
        return false;
View Full Code Here

  @Override
  public boolean promptForIdentity(String message) {
    final Console console = System.console();
    showHeader(console);
   
    final String line = console.readLine("# %s [~/.ssh/id_pub]: ", message);
    final File home = new File(System.getProperty("java.home"));
   
    if (line == null || line.length() == 0) {
      identity = new File(home, ".ssh/id_pub").getAbsolutePath();
      return true;
View Full Code Here

      return swingCredentialsDialog(title, description, username, password);
    }

    final Console console = System.console();
    console.printf("#\n# %s\n# %s\n#\n", title, description);
    final String user = console.readLine("# %s: ", username);
    final char[] pass = console.readPassword("# %s: ", password);
    console.printf("#\n");

    return new String[] { user, new String(pass) };
  }
View Full Code Here

            System.err.println("No console.");
            System.exit(1);
        }

        while (encDir == null || encDir.length() == 0 || !(encDir.endsWith("/") || encDir.endsWith("\\"))) {
            encDir = console
                    .readLine("Enter directory to store encrypted files (end with either / or \\ based on Unix or Windows:");
        }

        while (keystoreURL == null || keystoreURL.length() == 0) {
            keystoreURL = console.readLine("Enter Keystore URL:");
View Full Code Here

            encDir = console
                    .readLine("Enter directory to store encrypted files (end with either / or \\ based on Unix or Windows:");
        }

        while (keystoreURL == null || keystoreURL.length() == 0) {
            keystoreURL = console.readLine("Enter Keystore URL:");
        }

        char[] keystorePasswd = getSensitiveValue("Enter Keystore password");

        try {
View Full Code Here

        } catch (Exception e) {
            System.out.println("Exception encountered:" + e.getLocalizedMessage());
        }

        while (keystoreAlias == null || keystoreAlias.length() == 0) {
            keystoreAlias = console.readLine("Enter Keystore Alias:");
        }

        try {
            vault = SecurityVaultFactory.get();
            System.out.println("Obtained Vault");
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.