Examples of StreamGobbler


Examples of ch.ethz.ssh2.StreamGobbler

      sess = conn.openSession();
      // get millisecond spent in IO from beginning of time for disk
      // diskname
      sess.execCommand("cat /proc/diskstats | grep \"" + diskname + " \"");

      InputStream stdout = new StreamGobbler(sess.getStdout());
      BufferedReader br = new BufferedReader(
          new InputStreamReader(stdout));
      String line = br.readLine();

      StringTokenizer st = new StringTokenizer(line);
View Full Code Here

Examples of ch.ethz.ssh2.StreamGobbler

        {
            String message = "Cannot execute remote command: " + command;
            throw new CommandAbortedException( message, message );
        }

        InputStream stdout = new StreamGobbler( session.getStdout() );
        InputStream stderr = new StreamGobbler( session.getStderr() );
        stderrReader = new BufferedReader( new InputStreamReader( stderr ) );
        setInputStream( new LoggedDataInputStream( stdout ) );
        setOutputStream( new LoggedDataOutputStream( session.getStdin() ) );
    }
View Full Code Here

Examples of com.salesforce.dataloader.util.StreamGobbler

                        public void run() {
                            int exitVal = 0;
                            try {
                                String[] cmd = { "cmd.exe", "/c", "\"" + filename + "\"" }; //$NON-NLS-1$ //$NON-NLS-2$
                                Process proc = Runtime.getRuntime().exec(cmd);
                                StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); //$NON-NLS-1$
                                StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT"); //$NON-NLS-1$
                                errorGobbler.start();
                                outputGobbler.start();
                                exitVal = proc.waitFor();
                            } catch (IOException iox) {
                                logger.error(Labels.getString("CSVViewerDialog.errorExternal"), iox); //$NON-NLS-1$
                            } catch (InterruptedException ie) {
                                logger.error(Labels.getString("CSVViewerDialog.errorExternal"), ie); //$NON-NLS-1$
View Full Code Here

Examples of com.salesforce.dataloader.util.StreamGobbler

                    @Override
                    public void run() {
                        int exitVal = 0;
                        try {
                            Process proc = Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler " + linkURL);
                            StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); //$NON-NLS-1$
                            StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT"); //$NON-NLS-1$
                            errorGobbler.start();
                            outputGobbler.start();
                            exitVal = proc.waitFor();
                        } catch (IOException iox) {
                            logger.error("Browser Error", iox);
                        } catch (InterruptedException ie) {
                            logger.error("Browser Error", ie);
View Full Code Here

Examples of com.trilead.ssh2.StreamGobbler

      objSSHSession = this.getSshConnection().openSession();
      logger.debug("Executing command " + checkShellCommand);
      objSSHSession.execCommand(checkShellCommand);

      logger.debug("output to stdout for remote command: " + checkShellCommand);
      ipsStdOut = new StreamGobbler(objSSHSession.getStdout());
      ipsStdErr = new StreamGobbler(objSSHSession.getStderr());
      BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(ipsStdOut));
      String stdOut = "";
      while (true) {
        String line = stdoutReader.readLine();
        if (line == null)
View Full Code Here

Examples of com.trilead.ssh2.StreamGobbler

      }

      this.getSshSession().execCommand(strCmd);

      logger.debug("output to stdout for remote command: " + strCmd);
      ipsStdOut = new StreamGobbler(this.getSshSession().getStdout());
      ipsStdErr = new StreamGobbler(this.getSshSession().getStderr());
      BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(ipsStdOut));
      strbStdoutOutput = new StringBuffer();
      while (true) {
        String line = stdoutReader.readLine();
        if (line == null)
View Full Code Here

Examples of com.trilead.ssh2.StreamGobbler

            spooler_log.debug5("executing remote command: " + command);
            this.setSshSession(this.getSshConnection().openSession());
            this.getSshSession().execCommand(command);

            spooler_log.debug5("output to stdout for remote command: " + command);
            InputStream stdout = new StreamGobbler(this.getSshSession().getStdout());
            BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(stdout));
            while (true) {
                String line = stdoutReader.readLine();
                if (line == null) break;
                spooler_log.info(line);
            }

            spooler_log.debug5("output to stderr for remote command: " + command);
            InputStream stderr = new StreamGobbler(this.getSshSession().getStderr());
            BufferedReader stderrReader = new BufferedReader(new InputStreamReader(stderr));
            String stderrOutput = "";
            while (true) {
                String line = stderrReader.readLine();
                if (line == null) break;
View Full Code Here

Examples of com.trilead.ssh2.StreamGobbler

      spooler_log.debug5("fetching children");
      this.getSshSession().execCommand("/bin/ps -ef");

      spooler_log.debug9("output to stdout for ps command: ");
      stdout = new StreamGobbler(this.getSshSession().getStdout());
      stderr = new StreamGobbler(this.getSshSession().getStderr());
      BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(stdout));
      String line = stdoutReader.readLine(); //Ueberschrift
      spooler_log.debug9(line);

View Full Code Here

Examples of com.trilead.ssh2.StreamGobbler

  private void executeCommand(String command, int logLevel) throws Exception{
    Session session = getSshConnection().openSession();
    try{
      session.execCommand(command);
      spooler_log.log(logLevel,"output to stdout for remote command: " + command);
      stdout = new StreamGobbler(this.getSshSession().getStdout());
      stderr = new StreamGobbler(this.getSshSession().getStderr());
      BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(stdout));

      while (true) {
        String line = stdoutReader.readLine();
        if (line == null) break;
View Full Code Here

Examples of com.trilead.ssh2.StreamGobbler

            }

            this.getSshSession().execCommand(currentCommand);

            getLogger().debug("output to stdout for remote command: " + normalizedPassword(this.getCommands()[i]));
            stdout = new StreamGobbler(this.getSshSession().getStdout());
            stderr = new StreamGobbler(this.getSshSession().getStderr());
            BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(stdout));
            int pid = 0;
            while (true) {
              String line = stdoutReader.readLine();
              if (line == null)
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.