public class SSHEnvironment extends AbstractConfigurationEnvironment
| Constructor and Description |
|---|
SSHEnvironment(int id,
java.lang.String username,
java.nio.file.Path privateKeyPath,
java.net.InetAddress remoteInetAddress,
java.lang.String remoteHomePath,
java.util.concurrent.Executor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyFilesFromLocalDisk(java.nio.file.Path srcPath,
java.lang.String destRelPath) |
void |
copyFilesToLocalDisk(java.lang.String srcRelPath,
java.nio.file.Path destPath) |
java.lang.String |
getHostname() |
int |
getId() |
java.lang.String |
getName() |
void |
mkdirs(java.lang.String directoryPath)
Create directories in environment if they don't exist.
|
void |
removeFile(java.lang.String relPath)
Removes specified file.
|
RemoteProcess |
runCommand(java.util.List<java.lang.String> command)
Synchronously runs arbitrary command on this environment's OS.
|
RemoteProcess |
runCommandAsynchronously(java.util.List<java.lang.String> command) |
getProperty, setPropertypublic SSHEnvironment(int id,
java.lang.String username,
java.nio.file.Path privateKeyPath,
java.net.InetAddress remoteInetAddress,
java.lang.String remoteHomePath,
java.util.concurrent.Executor executor)
public void copyFilesFromLocalDisk(java.nio.file.Path srcPath,
java.lang.String destRelPath)
throws java.io.IOException
srcPath - Local source path.destRelPath - Relative destination directory on this environment.java.io.IOExceptionpublic void copyFilesToLocalDisk(java.lang.String srcRelPath,
java.nio.file.Path destPath)
throws java.io.IOException
srcRelPath - Relative source path on this environment.destPath - Local destination directory.java.io.IOExceptionpublic java.lang.String getHostname()
public int getId()
public java.lang.String getName()
public void mkdirs(java.lang.String directoryPath)
throws java.io.IOException
directoryPath - path to createjava.io.IOExceptionpublic void removeFile(java.lang.String relPath)
throws java.lang.InterruptedException,
java.io.IOException
EnvironmentrelPath - Relative path to file on this environment.java.io.IOExceptionjava.lang.InterruptedExceptionpublic RemoteProcess runCommand(java.util.List<java.lang.String> command) throws java.lang.InterruptedException, java.io.IOException
Environmentjava.lang.InterruptedExceptionjava.io.IOExceptionpublic RemoteProcess runCommandAsynchronously(java.util.List<java.lang.String> command) throws java.io.IOException
java.io.IOException