|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HostSession
A session on a host (local or remote) on which to manipulate files and execute commands.
| Method Summary | |
|---|---|
void |
close()
Closes the host session. |
HostFile |
copyToTemporaryFile(java.io.File localFile)
Copies a local file to a temporary file on the host. |
HostFile |
copyToTemporaryFile(org.springframework.core.io.Resource resource)
Copies a resource to a temporary file on the host. |
int |
execute(CommandExecutionCallbackHandler handler,
java.util.Map<java.lang.String,java.lang.String> inputResponse,
java.lang.String... commandLine)
Executes a command and responds to any output with the provided responses. |
int |
execute(CommandExecutionCallbackHandler handler,
java.lang.String... commandLine)
Executes a command with its arguments. |
HostFile |
getFile(HostFile parent,
java.lang.String child)
Creates a reference to a file in a directory on the host. |
HostFile |
getFile(java.lang.String hostPath)
Creates a reference to a file on the host. |
OperatingSystemFamily |
getHostOperatingSystem()
Return the OS family of the host. |
HostFile |
getTempFile(java.lang.String nameTemplate)
Creates a reference to a temporary file on the host. |
HostFile |
getTempFile(java.lang.String prefix,
java.lang.String suffix)
Creates a reference to a temporary file on the host. |
CommandExecution |
startExecute(java.lang.String... commandLine)
Starts the execution of a command and gives the caller full control over the execution. |
| Method Detail |
|---|
OperatingSystemFamily getHostOperatingSystem()
void close()
RuntimeException
HostFile getFile(java.lang.String hostPath)
throws RuntimeIOException
hostPath - the path of the host
RuntimeIOException - if an I/O error occurs
HostFile getFile(HostFile parent,
java.lang.String child)
throws RuntimeIOException
parent - the reference to the directory on the hostchild - the name of the file in the directory
RuntimeIOException - if an I/O error occurs
HostFile getTempFile(java.lang.String nameTemplate)
throws RuntimeIOException
nameTemplate - the template on which to base the name of the temporary file. May be null.
RuntimeIOException - if an I/O error occurs
HostFile getTempFile(java.lang.String prefix,
java.lang.String suffix)
throws RuntimeIOException
prefix - the prefix string to be used in generating the file's name; must be at least three characters longsuffix - the suffix string to be used in generating the file's name; may be null, in which case
the suffix ".tmp" will be used
RuntimeIOException - if an I/O error occurs
int execute(CommandExecutionCallbackHandler handler,
java.lang.String... commandLine)
throws RuntimeIOException
handler - the callback handler that will be invoked when the executed command generated output.commandLine - the command line to execute. The first element is the command, the other elements are its arguments.
RuntimeIOException - if an I/O error occurs
int execute(CommandExecutionCallbackHandler handler,
java.util.Map<java.lang.String,java.lang.String> inputResponse,
java.lang.String... commandLine)
handler - the callback handler that will be invoked when the executed command generated output.inputResponse - expected output and the response to sendcommandLine - the command line to execute. The first element is the command, the other elements are its arguments.
RuntimeIOException - if an I/O error occursCommandExecution startExecute(java.lang.String... commandLine)
commandLine - the command line to execute. The first element is the command, the other elements are its arguments.
RuntimeIOException - if an I/O error occurs
HostFile copyToTemporaryFile(java.io.File localFile)
throws RuntimeIOException
localFile - the local file to copy
RuntimeIOException
HostFile copyToTemporaryFile(org.springframework.core.io.Resource resource)
throws RuntimeIOException
resource - the resource to copy
RuntimeIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||