Class RemoteSSHConnection


  • public class RemoteSSHConnection
    extends Object
    • Constructor Detail

      • RemoteSSHConnection

        public RemoteSSHConnection​(String user,
                                   String password,
                                   String remoteHost,
                                   String pemFile)
                            throws Exception
        Default constructor.
        Parameters:
        user - the user
        password - the password
        remoteHost - the remote host
        pemFile - the pem file
        Throws:
        Exception - the exception
    • Method Detail

      • getSession

        public com.jcraft.jsch.Session getSession()
      • setSession

        public void setSession​(com.jcraft.jsch.Session session)
      • getResult

        public String getResult()
      • setResult

        public void setResult​(String result)
      • getExitStatus

        public int getExitStatus()
      • setExitStatus

        public void setExitStatus​(int exitStatus)
      • copyTo

        public void copyTo​(String localPath,
                           String remotePath)
                    throws Exception
        Copy localPath to remotePath using the session created
        Parameters:
        localPath - the local path
        remotePath - the remote path
        Throws:
        Exception - Exception
      • runCommand

        public void runCommand​(String command)
                        throws Exception
        Execute the command in the session created
        Parameters:
        command - the command to execute
        Throws:
        Exception - Exception
      • copyFrom

        public void copyFrom​(String remotePath,
                             String localPath)
                      throws Exception
        Copy remotePath to localPath using the session created
        Parameters:
        remotePath - the remote path
        localPath - the local path
        Throws:
        Exception - Exception
      • closeConnection

        public void closeConnection()
                             throws Exception
        Close connection
        Throws:
        Exception - Exception