public class CommandExecutors extends Object
Modifier and Type | Method and Description |
---|---|
static void |
execCommand(ICommandExecutor executor,
OutputStream transfer)
执行命令
|
static void |
execCommand(ICommandExecutor executor,
OutputStream transfer,
boolean merge)
执行命令
|
static byte[] |
getCommandOutputResult(ICommandExecutor executor)
执行命令获取命令输出
|
static String |
getCommandOutputResult(String host,
int port,
String username,
String password,
String command)
执行命令获取命令输出
|
static String |
getCommandOutputResult(String host,
String username,
String password,
String command)
执行命令获取命令输出
|
static String |
getCommandOutputResultString(ICommandExecutor executor)
执行命令获取命令输出
|
public static String getCommandOutputResult(String host, String username, String password, String command) throws IOException
host
- 机器主机username
- 用户名password
- 密码command
- 命令IOException
- IOExceptionpublic static String getCommandOutputResult(String host, int port, String username, String password, String command) throws IOException
host
- 机器主机port
- portusername
- 用户名password
- 密码command
- 命令IOException
- IOExceptionpublic static String getCommandOutputResultString(ICommandExecutor executor) throws IOException
executor
- executorIOException
- IOExceptionpublic static byte[] getCommandOutputResult(ICommandExecutor executor) throws IOException
executor
- executorIOException
- IOExceptionpublic static void execCommand(ICommandExecutor executor, OutputStream transfer) throws IOException
executor
- executortransfer
- transferIOException
- IOExceptionpublic static void execCommand(ICommandExecutor executor, OutputStream transfer, boolean merge) throws IOException
executor
- executortransfer
- transfermerge
- mergeIOException
- IOExceptionCopyright © 2024. All rights reserved.