org.apache.tools.ant.taskdefs.optional.ssh
public class SSHExec extends SSHBase
Since: Ant 1.6 (created February 2, 2003)
Constructor Summary | |
---|---|
SSHExec()
Constructor for SSHExecTask. |
Method Summary | |
---|---|
void | execute()
Execute the command on the remote host.
|
void | setAppend(boolean append)
Determines if the output is appended to the file given in
setOutput . |
void | setCommand(String command)
Sets the command to execute on the remote host.
|
void | setCommandResource(String f)
Sets a commandResource from a file |
void | setInput(File input)
If used, the content of the file is piped to the remote command
|
void | setInputProperty(String inputProperty)
If used, the content of the property is piped to the remote command
|
void | setInputString(String inputString)
If used, the string is piped to the remote command.
|
void | setOutput(File output)
If used, stores the output of the command to the given file.
|
void | setOutputproperty(String property)
If set, the output of the command will be stored in the given property.
|
void | setTimeout(long timeout)
The connection can be dropped after a specified number of
milliseconds. |
void | setUsePty(boolean b)
Whether a pseudo-tty should be allocated. |
Throws: BuildException Most likely a network error or bad parameter.
setOutput
. Default is false, that is, overwrite
the file.
Parameters: append True to append to an existing file, false to overwrite.
Parameters: command The new command value
Parameters: f the value to use.
Since: Ant 1.7.1
Parameters: input The file which provides the input data for the remote command
Since: Ant 1.8.0
Parameters: inputProperty The property which contains the input data for the remote command.
Since: Ant 1.8.0
Parameters: inputString the input data for the remote command.
Since: Ant 1.8.3
Parameters: output The file to write to.
Parameters: property The name of the property in which the command output will be stored.
Parameters: timeout The new timeout value in seconds
Since: Apache Ant 1.8.3