public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static void |
consumeProcessStream(InputStream stream)
Consumes everything written by a stream.
|
static String |
getDefaultJavaPath()
Get default javaPath: use Java from JAVA_HOME if defined, otherwise use Java from system property java.home
|
static Process |
runSSHCommand(InetAddress host,
String cmd,
String sshOptions)
Execute a specific command on a remote host through SSH
|
public static Process runSSHCommand(InetAddress host, String cmd, String sshOptions) throws IOException
host
- the remote host on which to execute the commandcmd
- the command to execute on the remote hostsshOptions
- the options that will be passed to the ssh commandIOException
- SSH command execution failedpublic static void consumeProcessStream(InputStream stream)
public static String getDefaultJavaPath()