Search in sources :

Example 1 with JschSftpSession

use of com.jn.agileway.ssh.client.impl.jsch.sftp.JschSftpSession in project agileway by fangjinuo.

the class JschConnection method openSftpSession.

@Override
public SftpSession openSftpSession() throws SshException {
    try {
        ChannelSftp channel = (ChannelSftp) this.delegate.openChannel("sftp");
        channel.connect();
        JschSftpSession session = new JschSftpSession(channel);
        session.setSshConnection(this);
        return session;
    } catch (JSchException ex) {
        throw new SshException(ex);
    }
}
Also used : JSchException(com.jcraft.jsch.JSchException) ChannelSftp(com.jcraft.jsch.ChannelSftp) JschSftpSession(com.jn.agileway.ssh.client.impl.jsch.sftp.JschSftpSession) SshException(com.jn.agileway.ssh.client.SshException)

Aggregations

ChannelSftp (com.jcraft.jsch.ChannelSftp)1 JSchException (com.jcraft.jsch.JSchException)1 SshException (com.jn.agileway.ssh.client.SshException)1 JschSftpSession (com.jn.agileway.ssh.client.impl.jsch.sftp.JschSftpSession)1