Package com.jcraft.jsch

Examples of com.jcraft.jsch.ChannelExec.disconnect()


        c.setCommand("scp -f " + path);
        c.connect();
        OutputStream os = c.getOutputStream();
        InputStream is = c.getInputStream();
        assertEquals(2, is.read());
        c.disconnect();
        return null;
    }

    protected void sendFile(String path, String name, String data) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
View Full Code Here


        os.write(data.getBytes());
        os.flush();
        assertEquals(0, is.read());
        os.write(0);
        os.flush();
        c.disconnect();
    }

    protected void sendFileError(String path, String name, String data) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
        c.setCommand("scp -t " + path);
View Full Code Here

        {
            IOUtil.close( stdoutReader );
            IOUtil.close( stderrReader );
            if ( channel != null )
            {
                channel.disconnect();
            }
        }
    }

    protected void handleGetException( Resource resource, Exception e )
View Full Code Here

            }

            int exitStatus = channel.getExitStatus();

            log.info("closing connection");
            channel.disconnect();
            session.disconnect();

            return new BootstrapResultInformation().
                    withInstanceInfo(instanceInfo).
                    withExitStatus(exitStatus);
View Full Code Here

            }

            int exitStatus = channel.getExitStatus();

            log.info("closing connection");
            channel.disconnect();
            session.disconnect();

            return new TestResultInformation().
                    withInstanceInfo(instanceInfo).
                    withExitStatus(exitStatus);
View Full Code Here

            }

            log.info("closing scp connection");
            in.close();
            out.close();
            channel.disconnect();

            return new BootstrapCommandInformation().
                    withSessionInfo(sessionInfo).
                    withCommand(filename);
        }
View Full Code Here

        {
            IOUtil.close( stdoutReader );
            IOUtil.close( stderrReader );
            if ( channel != null )
            {
                channel.disconnect();
            }
        }
    }

    protected void handleGetException( Resource resource, Exception e )
View Full Code Here

          + numBytes + "].");
      if (channel != null)
      {
        LOGGER.info("remoteExec(InputStream, OutputStream) -  exit code: "
            + channel.getExitStatus());
        channel.disconnect();
      }
      if (out != null)
      {
        out.flush();
        out.close();
View Full Code Here

        assertEquals(length, buffer.length);
        assertEquals(0, is.read());
        os.write(0);
        os.flush();

        c.disconnect();
        return new String(buffer);
    }

    protected String readDir(String path) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
View Full Code Here

        os.write(0);
        os.flush();
        header = readLine(is);
        assertEquals("E", header);

        c.disconnect();
        return new String(buffer);
    }

    protected String readFileError(String path) throws Exception {
        ChannelExec c = (ChannelExec) session.openChannel("exec");
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.