org.apache.tools.ant.taskdefs.optional.ssh
public abstract class AbstractSshMessage extends Object
Constructor Summary | |
---|---|
AbstractSshMessage(Session session)
Constructor for AbstractSshMessage | |
AbstractSshMessage(boolean verbose, Session session)
Constructor for AbstractSshMessage |
Method Summary | |
---|---|
abstract void | execute()
Carry out the transfer. |
protected SftpProgressMonitor | getProgressMonitor()
Get the progress monitor. |
protected boolean | getVerbose()
Is the verbose attribute set. |
protected void | log(String message)
Log a message to the log listener. |
protected void | logStats(long timeStarted, long timeEnded, long totalLength)
Log transfer stats to the log listener. |
protected Channel | openExecChannel(String command)
Open an ssh channel. |
protected ChannelSftp | openSftpChannel()
Open an ssh sftp channel. |
protected void | sendAck(OutputStream out)
Send an ack. |
void | setLogListener(LogListener aListener)
Set a log listener. |
protected int | trackProgress(long filesize, long totalLength, int percentTransmitted)
Track progress every 10% if 100kb < filesize < 1mb. |
protected void | waitForAck(InputStream in)
Reads the response, throws a BuildException if the response
indicates an error. |
Parameters: session the ssh session to use
Parameters: verbose if true do verbose logging session the ssh session to use
Since: Ant 1.6.2
Throws: IOException on I/O errors JSchException on ssh errors
Returns: the progress monitor.
Returns: true if the verbose attribute is set
Since: Ant 1.6.2
Parameters: message the message to log
Parameters: timeStarted the time started timeEnded the finishing time totalLength the total length
Parameters: command the command to use
Returns: the channel
Throws: JSchException on error
Returns: the channel
Throws: JSchException on error
Parameters: out the output stream to use
Throws: IOException on error
Parameters: aListener the log listener
Parameters: filesize the size of the file been transmitted totalLength the total transmission size percentTransmitted the current percent transmitted
Returns: the percent that the file is of the total
Parameters: in the input stream to use
Throws: IOException on I/O error BuildException on other errors