Package me.saro.commons.ssh
Class SSHExecutor
- java.lang.Object
-
- me.saro.commons.ssh.SSHExecutor
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class SSHExecutor extends java.lang.Object implements java.io.Closeable- Since:
- 1.2
-
-
Method Summary
Modifier and Type Method Description voidclose()closejava.lang.Stringcmd(java.lang.String... cmds)send commendstatic java.lang.Stringjust(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 resultstatic SSHExecutoropen(java.lang.String host, int port, java.lang.String user, java.lang.String pass, java.lang.String charset)open ssh
-
-
-
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.IOExceptionsend 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.IOExceptionsend commend- Parameters:
cmd-- Returns:
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionclose- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-