Package org.jboss.fresh.shell.ejb

Examples of org.jboss.fresh.shell.ejb.RemoteShell.execute()


                log.debug(cmd);
                if (shell != null) {
                    pinf = shell.execute(cmd);
                    sos = new ShellOutputStream(shell, pinf.procid);
                } else {
                    pinf = rshell.execute(cmd);
                    sos = new ShellOutputStream(rshell, pinf.procid);
                }
                osw = new OutputStreamWriter(sos, "UTF-8");
                osw.write(content);
                log.log(NOTICE, "Created file " + file + ", processed " + content.length() + " characters.");
View Full Code Here


                cmd = "cat > " + file + " &< " + f.getAbsolutePath();
                log.debug(cmd);
                if (shell != null) {
                    shell.execute(cmd);
                } else {
                    rshell.execute(cmd);
                }
                log.log(NOTICE, "Created file " + file + ", wrote " + f.length() + " bytes.");
            } else if (url != null) {
                InputStream is = null;
                try {
View Full Code Here

                    log.debug(cmd);
                    if (shell != null) {
                        pinf = shell.execute(cmd);
                        sos = new ShellOutputStream(shell, pinf.procid);
                    } else {
                        pinf = rshell.execute(cmd);
                        sos = new ShellOutputStream(rshell, pinf.procid);
                    }

                    long size = IOUtils.copy(is, sos);
View Full Code Here

                cmd = "touch " + file;
                log.debug(cmd);
                if (shell != null) {
                    shell.execute(cmd);
                } else {
                    rshell.execute(cmd);
                }
                log.log(NOTICE, "Created empty file " + file + ".");
            }

        } finally {
View Full Code Here

                              out.println(getTime() + " Executing: " + cmd);
                              out.flush();
                            }

                          if(! "".equals(cmd)) {
                            ProcessInfo pinf = shell.execute(cmd);
                              BufferedInputStream bin = new BufferedInputStream(new ShellConsoleInputStream(new ShellObjectReader(shell, pinf.procid)));
                              try {
                                  IOUtils.copy(bin, bos, 50000);
                              } catch (Exception ex) {
                                  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.