Package jline.console

Examples of jline.console.ConsoleReader


    public String readLine(String msg) throws IOException {
        return readLine(msg, null);
    }

    public String readLine(String msg, Character mask) throws IOException {
        ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
        return reader.readLine(msg, mask);
    }
View Full Code Here


        this.setCompletionMode();
        this.closeCallback = closeCallback;
        this.bundleContext = bc;

        try {
            reader = new ConsoleReader(null,
                    this.consoleInput,
                    this.out,
                    this.terminal,
                    encoding);
        } catch (IOException e) {
View Full Code Here

            if (reboot) {
                msg = String.format("Confirm: reboot instance %s (yes/no): ", karafName);
            } else {
                msg = String.format("Confirm: halt instance %s (yes/no): ", karafName);
            }
            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
            String str = reader.readLine(msg);
            if (str.equalsIgnoreCase("yes")) {
                if (reboot) {
                    systemService.reboot(time, determineSwipeType());
                } else {
                    systemService.halt(time);
View Full Code Here

     * @return true if the user confirm
     * @throws IOException
     */
    public static boolean accessToSystemBundleIsAllowed(long bundleId, CommandSession session) throws IOException {
        for (; ; ) {
            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
            String msg = "You are about to access system bundle " + bundleId + ".  Do you wish to continue (yes/no): ";
            String str = reader.readLine(msg);
            if ("yes".equalsIgnoreCase(str)) {
                return true;
            }
            if ("no".equalsIgnoreCase(str)) {
                return false;
View Full Code Here

        this.setCompletionMode();
        this.closeCallback = closeCallback;
        this.bundleContext = bc;

        try {
            reader = new ConsoleReader(null,
                    this.consoleInput,
                    this.out,
                    this.terminal,
                    encoding);
        } catch (IOException e) {
View Full Code Here

        this.session = processor.createSession(consoleInput, out, err);
        this.session.put("SCOPE", "shell:osgi:*");
        this.closeCallback = closeCallback;
        this.bundleContext = bc;

        reader = new ConsoleReader(null,
                                   this.consoleInput,
                                   this.out,
                                   this.terminal,
                                   encoding);

View Full Code Here

    public String readLine(String msg) throws IOException {
        return readLine(msg, null);
    }

    public String readLine(String msg, Character mask) throws IOException {
        ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
        return reader.readLine(msg, mask);
    }
View Full Code Here

        return null;
    }

    private boolean confirm(CommandSession session) throws IOException {
        for (;;) {
            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
            String msg = "You are about to perform a start/stop/refresh load test on bundles.\nDo you wish to continue (yes/no): ";
            String str = reader.readLine(msg);
            if ("yes".equalsIgnoreCase(str)) {
                return true;
            }
            if ("no".equalsIgnoreCase(str)) {
                return false;
View Full Code Here

    TestShell(String rootPass, String instanceName, String zookeepers, String configFile) throws IOException {
      // start the shell
      output = new TestOutputStream();
      input = new StringInputStream();
      PrintWriter pw = new PrintWriter(new OutputStreamWriter(output));
      shell = new Shell(new ConsoleReader(input, output), pw);
      shell.setLogErrorsToConsole();
      shell.config("-u", "root", "-p", rootPass, "-z", instanceName, zookeepers, "--config-file", configFile);
      exec("quit", true);
      shell.start();
      shell.setExit(false);
View Full Code Here

 
  private static ConsoleReader reader = null;
 
  private static ConsoleReader getConsoleReader() throws IOException {
    if (reader == null)
      reader = new ConsoleReader();
    return reader;
  }
View Full Code Here

TOP

Related Classes of jline.console.ConsoleReader

Copyright © 2018 www.massapicom. 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.