Package java.io

Examples of java.io.Console.readLine()


    String version = client.getCloudInfo().getVersion();
    if (Float.valueOf(version) >= 2.0) {
      //read org, using java.util.Formatter syntax :
      if (vcap_org == null) {
        vcap_org = console.readLine("Org to use? ");
      }
      //read space, using java.util.Formatter syntax :
      if (vcap_space == null) {
        vcap_space = console.readLine("Space to use? ");
      }
View Full Code Here


      if (vcap_org == null) {
        vcap_org = console.readLine("Org to use? ");
      }
      //read space, using java.util.Formatter syntax :
      if (vcap_space == null) {
        vcap_space = console.readLine("Space to use? ");
      }

      client =  clientOrgSpace(client);
    }
View Full Code Here

      }
      if (i ==0) {
        System.err.println("It looks like you don't have any services defined. Please create one first!");
        System.exit(1);
      }
      String svc = console.readLine("Which Service to connect to (" + 1 + "-" + i +")? ");
      int svc_ix = 0;
      try {
        svc_ix = Integer.parseInt(svc);
      } catch (NumberFormatException e) {
        System.err.println(svc + " is not a valid choice!");
View Full Code Here

    else {
      System.out.println("Connect client with username=" + svc_username +" password=" + svc_passwd + " " + txt_dbname + "=" + svc_dbname);
    }
    while (true) {
      if (console != null) {
        String command = console.readLine("Enter exit to stop: ");
        if (command.toLowerCase().equals("exit")) {
          break;
        }
      }
      try {
View Full Code Here

      Console con = System.console();
      Client client = new Client(con);
      con.printf(PROMPT);

      while (true) {
         String input = con.readLine(">");
         if ("quit".equals(input)) break;
         Command cmd = client.parseCommand(input);
         if (cmd == null) {
            con.printf("Unable to perform the requested action.\n");
         } else {
View Full Code Here

            // prompt for it (if interactive)
            Console cons = System.console();
            if (cons != null && programOpts.isInteractive()) {
                cons.printf("%s", strings.get("AdminUserRequiredPrompt",
                        SystemPropertyConstants.DEFAULT_ADMIN_USER));
                String val = cons.readLine();
                if (ok(val)) {
                    programOpts.setUser(val);
                    if (adminPassword == null) {
                        adminPassword = getAdminPassword();
                    }
View Full Code Here

            System.exit(1);
        }
        while (true) {

            Pattern pattern =
            Pattern.compile(console.readLine("%nEnter your regex: "));

            Matcher matcher =
            pattern.matcher(console.readLine("Enter input string to search: "));

            boolean found = false;
View Full Code Here

            Pattern pattern =
            Pattern.compile(console.readLine("%nEnter your regex: "));

            Matcher matcher =
            pattern.matcher(console.readLine("Enter input string to search: "));

            boolean found = false;
            while (matcher.find()) {
                console.format("I found the text \"%s\" starting at " +
                   "index %d and ending at index %d.%n",
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

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.