Package com.jcraft.jsch

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


            } catch (SftpException e) {
                throw new JSchException(e.toString());
            }
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

    private void sendDirectory(ChannelSftp channel,
View Full Code Here


                    +e.toString());
            schException.initCause(e);
            throw schException;
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
        log("done\n");
    }
View Full Code Here

    }

    //

    channel.disconnect();

    final int status = channel.getExitStatus();

    session.disconnect();
View Full Code Here

    fetcher.fetchFolder(channel, source, target, monitor);

    //

    channel.disconnect();

    final int status = channel.getExitStatus();

    session.disconnect();
View Full Code Here

                    +e.toString());
            schException.initCause(e);
            throw schException;
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
        log("done\n");
    }
View Full Code Here

                schException.initCause(e);
                throw schException;
            }
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

    private void doMultipleTransfer() throws IOException, JSchException {
View Full Code Here

                }
                throw new JSchException(msg, e);
            }
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

    private void sendDirectory(ChannelSftp channel,
View Full Code Here

        assertEquals("0123456789", readFile("target/scp/out.txt"));

        OutputStream os = c.put(target.getPath(), null, ChannelSftp.APPEND, -5);
        os.write("a".getBytes());
        os.close();
        c.disconnect();

        assertTrue(target.exists());
        assertEquals("01234a", readFile("target/scp/out.txt"));

        target.delete();
View Full Code Here

            }
        } finally {
            is.close();
        }

        c.disconnect();
        return new String(bos.toByteArray());
    }

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

    protected void sendFile(String path, String data) throws Exception {
        ChannelSftp c = (ChannelSftp) session.openChannel("sftp");
        c.connect();
        c.put(new ByteArrayInputStream(data.getBytes()), path);
        c.disconnect();
    }

}
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.