Class ScpToMessageBySftp
java.lang.Object
org.apache.tools.ant.taskdefs.optional.ssh.AbstractSshMessage
org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessage
org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessageBySftp
Utility class to carry out an upload by sftp.
- 
Constructor SummaryConstructorsConstructorDescriptionScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, File aLocalFile, String aRemotePath) Constructor for a local file to remote.ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, File aLocalFile, String aRemotePath, boolean preserveLastModified) Constructor for a local file to remote.ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, List<Directory> aDirectoryList, String aRemotePath) Constructor for a local directories to remote.ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, List<Directory> aDirectoryList, String aRemotePath, boolean preserveLastModified) Constructor for a local directories to remote.ScpToMessageBySftp(com.jcraft.jsch.Session session, File aLocalFile, String aRemotePath) Constructor for ScpToMessage.ScpToMessageBySftp(com.jcraft.jsch.Session session, List<Directory> aDirectoryList, String aRemotePath) Constructor for ScpToMessage.
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecute()Carry out the transfer.Get the local file.booleanReturns true if the last modified time needs to be preserved on the file(s) that get transferred.Get the remote path.Methods inherited from class org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessagegetDirMode, getFileMode, setDirMode, setFileModeMethods inherited from class org.apache.tools.ant.taskdefs.optional.ssh.AbstractSshMessagegetCompressed, getProgressMonitor, getVerbose, log, logStats, openExecChannel, openSftpChannel, sendAck, setLogListener, trackProgress, waitForAck
- 
Constructor Details- 
ScpToMessageBySftppublic ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, File aLocalFile, String aRemotePath) Constructor for a local file to remote.- Parameters:
- verbose- if true do verbose logging
- session- the scp session to use
- aLocalFile- the local file
- aRemotePath- the remote path
- Since:
- Ant 1.7
 
- 
ScpToMessageBySftppublic ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, File aLocalFile, String aRemotePath, boolean preserveLastModified) Constructor for a local file to remote.- Parameters:
- verbose- if true do verbose logging
- session- the scp session to use
- aLocalFile- the local file
- aRemotePath- the remote path
- preserveLastModified- True if the last modified time needs to be preserved on the transferred files. False otherwise.
- Since:
- Ant 1.9.10
 
- 
ScpToMessageBySftppublic ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, List<Directory> aDirectoryList, String aRemotePath) Constructor for a local directories to remote.- Parameters:
- verbose- if true do verbose logging
- session- the scp session to use
- aDirectoryList- a list of directories
- aRemotePath- the remote path
- Since:
- Ant 1.7
 
- 
ScpToMessageBySftppublic ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, List<Directory> aDirectoryList, String aRemotePath, boolean preserveLastModified) Constructor for a local directories to remote.- Parameters:
- verbose- if true do verbose logging
- session- the scp session to use
- aDirectoryList- a list of directories
- aRemotePath- the remote path
- preserveLastModified- True if the last modified time needs to be preserved on the transferred files. False otherwise.
- Since:
- Ant 1.9.10
 
- 
ScpToMessageBySftpConstructor for ScpToMessage.- Parameters:
- session- the scp session to use
- aLocalFile- the local file
- aRemotePath- the remote path
 
- 
ScpToMessageBySftppublic ScpToMessageBySftp(com.jcraft.jsch.Session session, List<Directory> aDirectoryList, String aRemotePath) Constructor for ScpToMessage.- Parameters:
- session- the scp session to use
- aDirectoryList- a list of directories
- aRemotePath- the remote path
 
 
- 
- 
Method Details- 
executeCarry out the transfer.- Overrides:
- executein class- ScpToMessage
- Throws:
- IOException- on i/o errors
- com.jcraft.jsch.JSchException- on errors detected by scp
 
- 
getLocalFileGet the local file.- Overrides:
- getLocalFilein class- ScpToMessage
- Returns:
- the local file.
 
- 
getRemotePathGet the remote path.- Overrides:
- getRemotePathin class- ScpToMessage
- Returns:
- the remote path.
 
- 
getPreserveLastModifiedpublic boolean getPreserveLastModified()Returns true if the last modified time needs to be preserved on the file(s) that get transferred. Returns false otherwise.- Overrides:
- getPreserveLastModifiedin class- ScpToMessage
- Returns:
- boolean
 
 
-