125126127128129130131132133134135
computer.setChannel(serverOutput, clientInput, taskListener, new Listener() { public void onClosed(hudson.remoting.Channel channel, IOException cause) { slaveChannel.disconnect(); sess.disconnect(); } }); LOGGER.info("Slave connected.");
158159160161162163164165166167168
waitForAck(in); sendFileToRemote(localFile, in, out); } finally { if (channel != null) { channel.disconnect(); } } } private void doMultipleTransfer() throws IOException, JSchException {
178179180181182183184185186187188
Directory current = (Directory) i.next(); sendDirectory(current, in, out); } } finally { if (channel != null) { channel.disconnect(); } } } private void sendDirectory(Directory current,
141142143144145146147148149150151
sendAck(out); startRemoteCpProtocol(in, out, localFile); } finally { if (channel != null) { channel.disconnect(); } } log("done\n"); }
131132133134135136137138139140141
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";
609610611612613614615616617618619
LOGGER.error("Failed to close SSH error stream reader", e); } } if (channel != null && channel.isConnected()) { channel.disconnect(); } } } /**
162163164165166167168169170171172
// 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.
287288289290291292293294295296297
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){}
902903904905906907908909910911912
882883884885886887888889890891892