public class SSHUtil
extends java.lang.Object
Constructor and Description |
---|
SSHUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.Future<java.lang.String> |
exec(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password,
java.lang.String command)
Execute a command on a remote SSH server
|
static java.util.concurrent.Future<java.lang.Boolean> |
getFile(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password,
java.lang.String remoteFile,
java.io.File localFile)
Retrieve a file from a remote SSH server
|
static java.util.concurrent.Future<java.lang.Boolean> |
putFile(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password,
java.io.File localFile,
java.lang.String remoteFile)
Send a local file to a remote SSH server
|
public static java.util.concurrent.Future<java.lang.String> exec(java.lang.String host, int port, java.lang.String user, java.lang.String password, java.lang.String command)
host
- The host where to connectport
- The port where SSH is runninguser
- The username to usepassword
- The password to use for authenticationcommand
- The command to be executed remotelypublic static java.util.concurrent.Future<java.lang.Boolean> getFile(java.lang.String host, int port, java.lang.String user, java.lang.String password, java.lang.String remoteFile, java.io.File localFile)
host
- The host where to connectport
- The port where SSH is runninguser
- The username to usepassword
- The password to use for authenticationlocalFile
- Where to store locally the remote file contentsremoteFile
- The path to the remote file to be retrievedpublic static java.util.concurrent.Future<java.lang.Boolean> putFile(java.lang.String host, int port, java.lang.String user, java.lang.String password, java.io.File localFile, java.lang.String remoteFile)
host
- The host where to connectport
- The port where SSH is runninguser
- The username to usepassword
- The password to use for authenticationlocalFile
- The File to be uploadedremoteFile
- The path to the file where to store remotelyCopyright © 2004-2020 FEUP-LSTS and Neptus developers. All Rights Reserved.