Package com.jcraft.jsch

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


            computer.setChannel(serverOutput, clientInput, taskListener,
                    new Listener() {

                        public void onClosed(hudson.remoting.Channel channel,
                                             IOException cause) {
                            slaveChannel.disconnect();
                            sess.disconnect();
                        }
                    });

            LOGGER.info("Slave connected.");
View Full Code Here


            waitForAck(in);
            sendFileToRemote(localFile, in, out);
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

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

                Directory current = (Directory) i.next();
                sendDirectory(current, in, out);
            }
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
    }

    private void sendDirectory(Directory current,
View Full Code Here

            sendAck(out);
            startRemoteCpProtocol(in, out, localFile);
        } finally {
            if (channel != null) {
                channel.disconnect();
            }
        }
        log("done\n");
    }
View Full Code Here

            File downloadFile = new File(path);
            FileOutputStream tempFileOutputStream =
                    new FileOutputStream(downloadFile);

            IOUtils.copy(c.get(filePath), tempFileOutputStream);
            channel.disconnect();
            session.disconnect();

            return downloadFile;
        } catch (Exception e) {
            final String msg = "Error downloading namespace";
View Full Code Here

          LOGGER.error("Failed to close SSH error stream reader", e);
        }
      }

      if (channel != null && channel.isConnected()) {
        channel.disconnect();
      }
    }
  }

  /**
 
View Full Code Here

            // After the command is executed, gather the results (both stdin and stderr).
            result.append(stdout.toString());
            result.append(stderr.toString());

            // Shutdown the connection
            channel.disconnect();
            session.disconnect();
        }
        catch(Throwable e){
            e.printStackTrace();
            // Return empty string if we can't connect.
View Full Code Here

            if(checkAck(in)!=0){
                return false;
            }
            out.close();

            channel.disconnect();
            session.disconnect();
        }
        catch(Exception e){
            System.out.println(e);
            try{if(fis!=null)fis.close();}catch(Exception ee){}
View Full Code Here

          LOGGER.error("Failed to close SSH error stream reader", e);
        }
      }

      if (channel != null && channel.isConnected()) {
        channel.disconnect();
      }
    }
  }

  /**
 
View Full Code Here

          LOGGER.error("Failed to close SSH error stream reader", e);
        }
      }

      if (channel != null && channel.isConnected()) {
        channel.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.