Class SSHExecutor

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class SSHExecutor
    extends java.lang.Object
    implements java.io.Closeable
    SSH
    there is just execute application and output in session
    recommend use the SSHShell
    Since:
    1.2
    • Method Summary

      Modifier and Type Method Description
      void close()
      close
      java.lang.String cmd​(java.lang.String... cmds)
      send commend
      static java.lang.String just​(java.lang.String host, int port, java.lang.String user, java.lang.String pass, java.lang.String charset, java.lang.String... cmds)
      send just commend and return result
      static SSHExecutor open​(java.lang.String host, int port, java.lang.String user, java.lang.String pass, java.lang.String charset)
      open ssh
      • Methods inherited from class java.lang.Object

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

      • open

        public static SSHExecutor open​(java.lang.String host,
                                       int port,
                                       java.lang.String user,
                                       java.lang.String pass,
                                       java.lang.String charset)
                                throws java.io.IOException
        open ssh
        Parameters:
        host -
        port -
        user -
        pass -
        charset -
        Returns:
        Throws:
        java.io.IOException
      • just

        public static java.lang.String just​(java.lang.String host,
                                            int port,
                                            java.lang.String user,
                                            java.lang.String pass,
                                            java.lang.String charset,
                                            java.lang.String... cmds)
                                     throws java.io.IOException
        send just commend and return result
        Parameters:
        host -
        port -
        user -
        pass -
        charset -
        cmd -
        Returns:
        Throws:
        java.io.IOException
      • cmd

        public java.lang.String cmd​(java.lang.String... cmds)
                             throws java.io.IOException
        send commend
        Parameters:
        cmd -
        Returns:
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        close
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException