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,
SSHClientFactory sshClientFactory,
FileUtils fileUtils) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyFilesFromLocalDisk(java.nio.file.Path srcPath,
java.lang.String destRelPath)
Copies specified file or directory to destination directory on environment.
|
void |
copyFilesToLocalDisk(java.lang.String srcRelPath,
java.nio.file.Path destPath)
Copies specified file or directory to destination directory on local host.
|
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,
SSHClientFactory sshClientFactory,
FileUtils fileUtils)
id - Environment's idusername - Username of remote accountprivateKeyPath - Path to private key fileremoteInetAddress - Remote host's addressremoteHomePath - Path to remote home where environment will be placed.
May be relative to user's home.executor - Executor for running remote commandssshClientFactory - Factory for SSHClientsfileUtils - Local file utilspublic void copyFilesFromLocalDisk(java.nio.file.Path srcPath,
java.lang.String destRelPath)
throws java.io.IOException
EnvironmentsrcPath - 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
EnvironmentsrcRelPath - 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.lang.InterruptedExceptionjava.io.IOExceptionpublic RemoteProcess runCommand(java.util.List<java.lang.String> command) throws java.lang.InterruptedException, java.io.IOException
Environmentcommand - Command to runjava.lang.InterruptedExceptionjava.io.IOExceptionpublic RemoteProcess runCommandAsynchronously(java.util.List<java.lang.String> command) throws java.io.IOException
java.io.IOException