Package org.jboss.fresh.io

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: project [--help] PROJECT_NAME\n");
      out.print("    PROJECT_NAME : the project to be activated. If no PROJECT_NAME is specified the current active project name is displayed.\n");
      out.print("    --help : this help\n");
      out.close();
      log.debug("done");
View Full Code Here


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


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

    boolean g = false;
    boolean l = false;
    boolean b = false;
    boolean help = false;
View Full Code Here

  // ctx -b bindname1 bindname2 bindname3
  // Will read 3 objects from shell-in and bind them under the specified names
  public void process(String exename, String[] params) throws Exception {
    log.debug("entered");
    if (helpRequested()) {
      PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));

      out.print("Usage:\n");
      out.print("  BIND some objects in the context under their respective names:\n");
      out.print("      <OBJ_GEN> | ctx [-ex] -b name1, name2, name3\n\n");
      out.print("  UNBIND some objects from the context:\n");
      out.print("      ctx [-ex] -u name1, name2, name3\n\n");
      out.print("  GET some objects from the context:\n");
      out.print("      ctx [-ex] -g name1, name2, name3 | <OBJ_CONSUMER>\n\n");
      out.print("  LIST children of an existing object to some other existing object:\n");
      out.print("      ctx [-ex] -l\n\n");
      out.print("    --help : this help\n");
      out.close();
      log.debug("done");
      return;
    }

    int action = -1;

    PrintWriter2 err = new PrintWriter2(new BufferWriter(getStdOut())), pout = err;


    LinkedList names = new LinkedList();

    Context ctx = shell.getContext();
View Full Code Here

  }


  private void printUsage() {

    PrintWriter2 pout = new PrintWriter2(new BufferedWriter(new BufferWriter(getStdOut())));

    pout.println("Usage:\n");
    pout.println("  BIND some objects in the context under their respective names:");
    pout.println("      <OBJ_GEN> | ctx [-ex] -b name1, name2, name3");
    pout.println();
View Full Code Here

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

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

    log.debug("entered");

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage: nexe native_command");
      out.print("\n   --help : this help.\n");
      out.close();
      log.debug("done");
      return;
    }

    pout = new PrintWriter(new BufferedWriter(new BufferWriter(getStdOut())));

    final int[] exitVal = new int[1];
    exitVal[0] = -1;

    try {
View Full Code Here

      in.close();
    } catch (Exception e) {
      if(canThrowEx()) {
        throw e;
      } else {
        org.jboss.fresh.io.BufferWriter bw = new BufferWriter(getStdOut());
        PrintWriter tOut = new PrintWriter(bw);
        tOut.write(e.toString());
      }
    }
    oout.close();
View Full Code Here

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

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage:\n");
      out.print("  cp [--help] FILES DEST_DIR\n");
      out.print("        FILES : files to be moved.\n");
      out.print("     DEST_DIR : directory to move the specified files to.\n");
      out.print("  cp [--help] FILE DEST_FILE\n");
      out.print("         FILE : file to be moved\n");
      out.print("    DEST_FILE : path of the destination file\n\n");
      out.print("    -f force copy (if one of the specified files does not exist we copy anyway)\n");
      out.print("    --help : this help\n");
      out.close();
      log.debug("done");
      return;
    }

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

      LinkedList paths = new LinkedList();
      boolean force = false;
View Full Code Here

TOP

Related Classes of org.jboss.fresh.io.BufferWriter

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.