Search in sources :

Example 41 with Session

use of com.jcraft.jsch.Session in project cdap by caskdata.

the class SFTPInputStream method close.

public synchronized void close() throws IOException {
    if (closed) {
        return;
    }
    super.close();
    closed = true;
    if (!channel.isConnected()) {
        throw new IOException(E_CLIENT_NOTCONNECTED);
    }
    try {
        Session session = channel.getSession();
        channel.disconnect();
        session.disconnect();
    } catch (JSchException e) {
        throw new IOException(StringUtils.stringifyException(e));
    }
}
Also used : JSchException(com.jcraft.jsch.JSchException) IOException(java.io.IOException) Session(com.jcraft.jsch.Session)

Aggregations

Session (com.jcraft.jsch.Session)41 JSch (com.jcraft.jsch.JSch)23 JSchException (com.jcraft.jsch.JSchException)20 IOException (java.io.IOException)16 Channel (com.jcraft.jsch.Channel)13 ChannelSftp (com.jcraft.jsch.ChannelSftp)11 File (java.io.File)9 ChannelExec (com.jcraft.jsch.ChannelExec)7 SftpException (com.jcraft.jsch.SftpException)7 InputStream (java.io.InputStream)7 FileInputStream (java.io.FileInputStream)6 UserInfo (com.jcraft.jsch.UserInfo)5 OutputStream (java.io.OutputStream)5 EditableDockerHost (com.microsoft.azure.docker.model.EditableDockerHost)4 DockerHost (com.microsoft.azure.docker.model.DockerHost)3 VirtualMachine (com.microsoft.azure.management.compute.VirtualMachine)3 AzureDockerPreferredSettings (com.microsoft.azure.docker.model.AzureDockerPreferredSettings)2 PublicIPAddress (com.microsoft.azure.management.network.PublicIPAddress)2 AzureInputDockerLoginCredsDialog (com.microsoft.azuretools.docker.ui.dialogs.AzureInputDockerLoginCredsDialog)2 AzureInputDockerLoginCredsDialog (com.microsoft.intellij.docker.dialogs.AzureInputDockerLoginCredsDialog)2