Examples of BufferWriter


Examples of org.jboss.fresh.io.BufferWriter

  public void process(String exepath, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage: ls [--help] [dir]\n");
      out.print("    dir : the directory to be viewed - if none is specified then the current working directory is viewed.\n");
      out.print("    --help : this help");
      out.close();
      log.debug("done");
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

  public void process(String exename, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested()) {
      PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));
      out.println("Usage: alias [--help] [-ex] <alias> <command_line>");
            out.println("    command_line parameter can be several parameters which will be concatenated");
            out.println("                 and seperated by spaces");
            out.println("    --list    : list existing aliases");
            out.println("    --listfull : list existing aliases and their values");
            out.println("    --help    : this help");
      out.close();
      log.debug("done");
      return;
    }

        String alias = null;
        if(params.length > 0) {

            alias = params[0];
            boolean full = "--listfull".equals(alias);

            if("--list".equals(alias) || full) {
                Map aliases = ((ShellImpl)shell).getRuntime().listAliases();
                PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));
                Iterator it = aliases.entrySet().iterator();
                while(it.hasNext()) {
                    Map.Entry ent = (Map.Entry) it.next();
                    out.println(ent.getKey() + ( full ?  "\t\t" + ent.getValue() : ""));
                }
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

    }
  }

  public void process(String exename, String[] params) throws Exception {

    PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));

    String word = new String();

    String[] invalids = getInvalidSwitches(args, "cEJPisvVhwx", new String[]{"count", "regexp", "ignore-case", "no-messages", "invert-match", "version", "help", "words", "lines"});
    useRegExp = isSwitchActive(args, new String[]{"E", "J", "P", "regexp"});
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

  public void process(String exename, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage: mkdir [--help] [-ex] PATHS\n");
      out.print("    PATHS : new directoryes to be made in the current working directory.\n");
      out.print("    --help : this help\n");
      out.close();
      log.debug("done");
      return;
    }

    PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
    VFS vfs = shell.getVFS();
    FileName pwd = new FileName(shell.getEnvProperty("PWD"));

    // List paths = new LinkedList();
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter


  public void process(String exepath, String[] params) throws Exception {
    log.debug("entered");

    PrintWriter err = new PrintWriter(new BufferWriter(getStdOut()));

    if (helpRequested()) {
      printUsage();
      log.debug("done");
      return;
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

  }


  public void printUsage() {
    PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
    out.println("Usage: events [--help] [-ex] <params> ...");
    out.println();
    out.println("  Instantiate new event listener and register it. The parameters after class are optional. If passed the constructor that takes one String parameter is used. If not present exception is thrown.");
    out.println("    events -a <class> -n <component_name> -p <pattern1> <pattern2> <pattern3> ...");
    out.println("  example:  events -a org.jboss.fresh.parsek.workflow.Conditon org.jboss.fresh.shell.commands.cms.PersistenceFilter conf1");
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

   */
  public void process(String exepath, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage: echo [--help] [params]\n");
      out.print("    params : parameters to be sent to the pipeline.\n");
      out.print("    --help : this help\n");
      out.close();
      log.debug("done.");
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

    }

    public void setOutBuffer(Buffer out) {
        this.out = out;
        if (out == null) return;
        bwo = new BufferWriter(out);
        bwo.setTimeout(ShellImpl.PROC_INST_TIMEOUT);
        wout = new PrintWriter(bwo, true);
    }
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

    errProcessed = true;

    if (canThrowEx()) {
      throw new Exception(msg);
    } else {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.println(msg);
      out.close();
      return;
    }
  }
View Full Code Here

Examples of org.jboss.fresh.io.BufferWriter

    errProcessed = true;

    if (canThrowEx()) {
      throw ex;
    } else {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.println(ex.getMessage());
      out.close();
      return;
    }
  }
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.