Package com.jcraft.jsch

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


            channel.setCommand(cmd);
            sendFile(channel, localFile, remoteTargetName, mode);
            channel.disconnect();
        } catch (JSchException e) {
            if (channel != null) {
                channel.disconnect();
            }
            throw (IOException) new IOException("Error during SCP transfer." + e.getMessage())
                    .initCause(e);
        }
    }
View Full Code Here


        try {
            channel = getExecChannel();
            channel.setCommand(cmd);
            receiveStream(channel, remoteFile, localTarget);
            channel.disconnect();
        } catch (JSchException e) {
            if (channel != null) {
                channel.disconnect();
            }
            throw (IOException) new IOException("Error during SCP transfer." + e.getMessage())
View Full Code Here

            channel.setCommand(cmd);
            receiveStream(channel, remoteFile, localTarget);
            channel.disconnect();
        } catch (JSchException e) {
            if (channel != null) {
                channel.disconnect();
            }
            throw (IOException) new IOException("Error during SCP transfer." + e.getMessage())
                    .initCause(e);
        }
    }
View Full Code Here

        try {
            channel = getExecChannel();
            channel.setCommand(cmd);
            fileInfo = receiveStream(channel, remoteFile, null);
            channel.disconnect();
        } catch (JSchException e) {
            throw (IOException) new IOException("Error during SCP transfer." + e.getMessage())
                    .initCause(e);
        } finally {
            if (channel != null) {
View Full Code Here

        } catch (JSchException e) {
            throw (IOException) new IOException("Error during SCP transfer." + e.getMessage())
                    .initCause(e);
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
        return fileInfo;
    }
}
View Full Code Here

            StringBuffer stdOut = new StringBuffer();
            StringBuffer stdErr = new StringBuffer();
            readSessionOutput(channel, stdOut, stdErr);
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

    /**
 
View Full Code Here

          throw new SecureSCPException("Invalid ACK response when sending file " + source);
       
        this.sendAckResponse(output);
      }
    } finally {
      scp.disconnect();
    }
  }
 
  /**
   * @param source The source for the contents to send
View Full Code Here

      if (this.getAckResponse(input) != ACK_OK)
        throw new SecureSCPException("Invalid ACK response when transfering file " + source);
     
      output.close();
    } finally {
      scp.disconnect();
      if (sourceInputStream != null) try { sourceInputStream.close(); } catch (IOException e) {}
    }
  }
 
  /**
 
View Full Code Here

            StringBuffer stdOut = new StringBuffer();
            StringBuffer stdErr = new StringBuffer();
            readSessionOutput(channel, stdOut, stdErr);
        } finally {
            if (channel != null)
                channel.disconnect();
        }
    }

    /**
     * check for existence of file or dir on target system
View Full Code Here

          if(channel.isClosed()){
            exitCode = channel.getExitStatus();
            break;
          }
      }
      channel.disconnect();
      long endTime = System.nanoTime();
      sessions.add(session);

      String outText = new String(outStr.toByteArray());
      String errText = new String(errStr.toByteArray());
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.