Package com.jcraft.jsch

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


          out.write(buf, 0, 1);
          out.flush();
        }
       
        logger.debug("A terminar sess�o...");
        session.disconnect();
      } catch(Exception e) {
        logger.error(e);
        try{
          if(fos != null) {
            fos.close();
View Full Code Here


        } finally {
            if (outputProperty != null) {
                getProject().setNewProperty(outputProperty, output.toString());
            }
            if (session != null && session.isConnected()) {
                session.disconnect();
            }
        }
    }

    private void executeCommand(Session session, String cmd, StringBuffer sb)
View Full Code Here

            log("Receiving file: " + file);
            message.setLogListener(this);
            message.execute();
        } finally {
            if (session != null) {
                session.disconnect();
            }
        }
    }

    private void upload(List fileSet, String toSshUri)
View Full Code Here

                message.setLogListener(this);
                message.execute();
            }
        } finally {
            if (session != null) {
                session.disconnect();
            }
        }
    }

    private void upload(String fromPath, String toSshUri)
View Full Code Here

            }
            message.setLogListener(this);
            message.execute();
        } finally {
            if (session != null) {
                session.disconnect();
            }
        }
    }

    private String parseUri(String uri) {
View Full Code Here

        }
        if (oldSession != null && !oldSession.equals(newSession) && oldSession.isConnected()) {
            entry.releaseChannelSftp();
            String oldhost = oldSession.getHost();
            Message.verbose(":: SSH :: closing ssh connection from " + oldhost + "...");
            oldSession.disconnect();
            Message.verbose(":: SSH :: ssh connection closed from " + oldhost);
        }
        if ((newSession == null) && (entry != null)) {
            uriCacheMap.remove(createCacheKey(user, host, port));
            if (entry.getSession() != null) {
View Full Code Here

      if (checkAck(in) != 0) {
        throw new RuntimeException("Failed to scp  file");
      }
      out.close();
      channel.disconnect();
      session.disconnect();
    } catch (JSchException e) {
      throw new IOException("Unable to copy key file to host: ", e);
    }
  }
View Full Code Here

        } catch (InterruptedException ee) {
          Thread.currentThread().interrupt();
        }
      }
      channel.disconnect();
      session.disconnect();
    } catch (JSchException e) {
      return false;
      // throw new IOException("Unable to ssh into master", e);
    }
    return true;
View Full Code Here

        if(oldSession != null && !oldSession.equals(newSession) &&
           oldSession.isConnected()) {
            entry.releaseChannelSftp();
            String oldhost = oldSession.getHost();
            Message.verbose(":: SSH :: closing ssh connection from "+oldhost+"...");
            oldSession.disconnect();
            Message.verbose(":: SSH :: ssh connection closed from "+oldhost);
        }
        if((newSession == null) && (entry != null)) {
            uriCacheMap.remove(createCacheKey(user, host, port));
            if(entry.getSession() != null)
View Full Code Here

          try{Thread.sleep(1000);}catch(Exception ee){}
        }
       
       
        channel.disconnect();
        session.disconnect();
      }
      catch(Exception e){
        System.out.println(e);
      }
   
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.