All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oneandone.iocunitejb.simulators.sftpclient.SftpConnection Maven / Gradle / Ivy

There is a newer version: 2.0.50
Show newest version
package com.oneandone.iocunitejb.simulators.sftpclient;

import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpException;

public class SftpConnection {

    private Session session;
    private ChannelSftp channel;
    private String pwd;

    public SftpConnection(Session session, ChannelSftp channel) throws SftpException {
        if (session == null) {
            throw new IllegalArgumentException("session must not be null");
        }
        if (channel == null) {
            throw new IllegalArgumentException("channel must not be null");
        }

        this.session = session;
        this.channel = channel;
        pwd = channel.pwd();
    }

    public Session getSession() {
        return session;
    }

    public ChannelSftp getChannel() {
        return channel;
    }

    public String getPwd() {
        return pwd;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy