Package org.ujmp.jsch

Class JSchUtil


  • public abstract class JSchUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      JSchUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.jcraft.jsch.Session createSession​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase)  
      static com.jcraft.jsch.UserInfo createUserInfo​(java.lang.String password)  
      static com.jcraft.jsch.Session forwardLocalPort​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, int localPortToForward, java.lang.String remoteHostToForwardTo, int remotePortToForwardTo)  
      static void installUJMP​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.lang.String destinationFolder)  
      static java.util.List<java.lang.String> ls​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.lang.String path)  
      static void mkdir​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.lang.String destinationFolder)  
      static java.lang.String pwd​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase)  
      static java.lang.String remoteExecute​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.lang.String command)  
      static java.lang.String remoteWget​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.lang.String url)  
      static void startOrInstallUJMP​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.lang.String destinationFolder)  
      static void startUJMP​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.lang.String destinationFolder)  
      static void uploadFile​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, byte[] data, java.lang.String destinationFolder, java.lang.String destinationFileName)  
      static void uploadFile​(java.lang.String hostname, int port, java.lang.String username, java.io.File keyFile, java.lang.String passphrase, java.io.File file, java.lang.String destinationFolder)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JSchUtil

        public JSchUtil()
    • Method Detail

      • remoteWget

        public static java.lang.String remoteWget​(java.lang.String hostname,
                                                  int port,
                                                  java.lang.String username,
                                                  java.io.File keyFile,
                                                  java.lang.String passphrase,
                                                  java.lang.String url)
                                           throws com.jcraft.jsch.JSchException,
                                                  java.io.IOException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
      • forwardLocalPort

        public static com.jcraft.jsch.Session forwardLocalPort​(java.lang.String hostname,
                                                               int port,
                                                               java.lang.String username,
                                                               java.io.File keyFile,
                                                               java.lang.String passphrase,
                                                               int localPortToForward,
                                                               java.lang.String remoteHostToForwardTo,
                                                               int remotePortToForwardTo)
                                                        throws com.jcraft.jsch.JSchException,
                                                               java.io.IOException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
      • mkdir

        public static void mkdir​(java.lang.String hostname,
                                 int port,
                                 java.lang.String username,
                                 java.io.File keyFile,
                                 java.lang.String passphrase,
                                 java.lang.String destinationFolder)
                          throws com.jcraft.jsch.JSchException,
                                 java.io.IOException,
                                 com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException
      • installUJMP

        public static void installUJMP​(java.lang.String hostname,
                                       int port,
                                       java.lang.String username,
                                       java.io.File keyFile,
                                       java.lang.String passphrase,
                                       java.lang.String destinationFolder)
                                throws com.jcraft.jsch.JSchException,
                                       java.io.IOException,
                                       com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException
      • startUJMP

        public static void startUJMP​(java.lang.String hostname,
                                     int port,
                                     java.lang.String username,
                                     java.io.File keyFile,
                                     java.lang.String passphrase,
                                     java.lang.String destinationFolder)
                              throws com.jcraft.jsch.JSchException,
                                     java.io.IOException,
                                     com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException
      • createSession

        public static com.jcraft.jsch.Session createSession​(java.lang.String hostname,
                                                            int port,
                                                            java.lang.String username,
                                                            java.io.File keyFile,
                                                            java.lang.String passphrase)
                                                     throws com.jcraft.jsch.JSchException
        Throws:
        com.jcraft.jsch.JSchException
      • pwd

        public static java.lang.String pwd​(java.lang.String hostname,
                                           int port,
                                           java.lang.String username,
                                           java.io.File keyFile,
                                           java.lang.String passphrase)
                                    throws com.jcraft.jsch.JSchException,
                                           java.io.IOException,
                                           com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException
      • ls

        public static java.util.List<java.lang.String> ls​(java.lang.String hostname,
                                                          int port,
                                                          java.lang.String username,
                                                          java.io.File keyFile,
                                                          java.lang.String passphrase,
                                                          java.lang.String path)
                                                   throws com.jcraft.jsch.JSchException,
                                                          java.io.IOException,
                                                          com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException
      • uploadFile

        public static void uploadFile​(java.lang.String hostname,
                                      int port,
                                      java.lang.String username,
                                      java.io.File keyFile,
                                      java.lang.String passphrase,
                                      java.io.File file,
                                      java.lang.String destinationFolder)
                               throws com.jcraft.jsch.JSchException,
                                      java.io.IOException,
                                      com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException
      • uploadFile

        public static void uploadFile​(java.lang.String hostname,
                                      int port,
                                      java.lang.String username,
                                      java.io.File keyFile,
                                      java.lang.String passphrase,
                                      byte[] data,
                                      java.lang.String destinationFolder,
                                      java.lang.String destinationFileName)
                               throws com.jcraft.jsch.JSchException,
                                      java.io.IOException,
                                      com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException
      • remoteExecute

        public static java.lang.String remoteExecute​(java.lang.String hostname,
                                                     int port,
                                                     java.lang.String username,
                                                     java.io.File keyFile,
                                                     java.lang.String passphrase,
                                                     java.lang.String command)
                                              throws com.jcraft.jsch.JSchException,
                                                     java.io.IOException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
      • createUserInfo

        public static com.jcraft.jsch.UserInfo createUserInfo​(java.lang.String password)
      • startOrInstallUJMP

        public static void startOrInstallUJMP​(java.lang.String hostname,
                                              int port,
                                              java.lang.String username,
                                              java.io.File keyFile,
                                              java.lang.String passphrase,
                                              java.lang.String destinationFolder)
                                       throws com.jcraft.jsch.JSchException,
                                              java.io.IOException,
                                              com.jcraft.jsch.SftpException
        Throws:
        com.jcraft.jsch.JSchException
        java.io.IOException
        com.jcraft.jsch.SftpException