Class ScpToMessage
- java.lang.Object
- 
- org.apache.tools.ant.taskdefs.optional.ssh.AbstractSshMessage
- 
- org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessage
 
 
- 
- Direct Known Subclasses:
- ScpToMessageBySftp
 
 public class ScpToMessage extends AbstractSshMessage Utility class to carry out an upload scp transfer.
- 
- 
Constructor SummaryConstructors Constructor Description ScpToMessage(boolean verbose, boolean compressed, com.jcraft.jsch.Session session)Constructor for ScpToMessageScpToMessage(boolean verbose, boolean compressed, com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath, boolean preserveLastModified)Constructor for a local file to remote.ScpToMessage(boolean verbose, boolean compressed, com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.String aRemotePath, boolean preserveLastModified)Constructor for a local directories to remote.ScpToMessage(boolean verbose, com.jcraft.jsch.Session session)Constructor for ScpToMessageScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath)Constructor for a local file to remote.ScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath, boolean preserveLastModified)Constructor for a local file to remote.ScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.String aRemotePath)Constructor for a local directories to remote.ScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.String aRemotePath, boolean preserveLastModified)Constructor for a local directories to remote.ScpToMessage(com.jcraft.jsch.Session session)Constructor for ScpToMessageScpToMessage(com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath)Constructor for ScpToMessage.ScpToMessage(com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.String aRemotePath)Constructor for ScpToMessage.
 - 
Method SummaryModifier and Type Method Description voidexecute()Carry out the transfer.intgetDirMode()Get the dir mode.intgetFileMode()Get the file mode.java.io.FilegetLocalFile()Get the local filebooleangetPreserveLastModified()Whether to preserve the last modified time.java.lang.StringgetRemotePath()Get the remote pathvoidsetDirMode(int dirMode)Set the dir mode, defaults to 0755.voidsetFileMode(int fileMode)Set the file mode, defaults to 0644.- 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.ssh.AbstractSshMessagegetCompressed, getProgressMonitor, getVerbose, log, logStats, openExecChannel, openSftpChannel, sendAck, setLogListener, trackProgress, waitForAck
 
- 
 
- 
- 
- 
Constructor Detail- 
ScpToMessagepublic ScpToMessage(com.jcraft.jsch.Session session) Constructor for ScpToMessage- Parameters:
- session- the ssh session to use
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, com.jcraft.jsch.Session session)Constructor for ScpToMessage- Parameters:
- verbose- if true do verbose logging
- session- the ssh session to use
- Since:
- Ant 1.7
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, boolean compressed, com.jcraft.jsch.Session session)Constructor for ScpToMessage- Parameters:
- verbose- if true do verbose logging
- compressed- if true use compression
- session- the ssh session to use
- Since:
- Ant 1.9.8
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.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- whether to preserve the last modified timestamps
- Since:
- Ant 1.9.7
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, boolean compressed, com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath, boolean preserveLastModified)Constructor for a local file to remote.- Parameters:
- verbose- if true do verbose logging
- compressed- if true use compression
- session- the scp session to use
- aLocalFile- the local file
- aRemotePath- the remote path
- preserveLastModified- whether to preserve the last modified timestamps
- Since:
- Ant 1.9.8
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.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- whether to preserve the last modified timestamps
- Since:
- Ant 1.9.7
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, boolean compressed, com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.String aRemotePath, boolean preserveLastModified)Constructor for a local directories to remote.- Parameters:
- verbose- if true do verbose logging
- compressed- whether to use compression
- session- the scp session to use
- aDirectoryList- a list of directories
- aRemotePath- the remote path
- preserveLastModified- whether to preserve the last modified timestamps
- Since:
- Ant 1.9.8
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.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.6.2
 
 - 
ScpToMessagepublic ScpToMessage(boolean verbose, com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.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.6.2
 
 - 
ScpToMessagepublic ScpToMessage(com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath)Constructor for ScpToMessage.- Parameters:
- session- the scp session to use
- aLocalFile- the local file
- aRemotePath- the remote path
 
 - 
ScpToMessagepublic ScpToMessage(com.jcraft.jsch.Session session, java.util.List<Directory> aDirectoryList, java.lang.String aRemotePath)Constructor for ScpToMessage.- Parameters:
- session- the scp session to use
- aDirectoryList- a list of directories
- aRemotePath- the remote path
 
 
- 
 - 
Method Detail- 
executepublic void execute() throws java.io.IOException, com.jcraft.jsch.JSchExceptionCarry out the transfer.- Specified by:
- executein class- AbstractSshMessage
- Throws:
- java.io.IOException- on i/o errors
- com.jcraft.jsch.JSchException- on errors detected by scp
 
 - 
getLocalFilepublic java.io.File getLocalFile() Get the local file- Returns:
- the local file
 
 - 
getRemotePathpublic java.lang.String getRemotePath() Get the remote path- Returns:
- the remote path
 
 - 
setFileModepublic void setFileMode(int fileMode) Set the file mode, defaults to 0644.- Parameters:
- fileMode- int
- Since:
- Ant 1.9.5
 
 - 
getFileModepublic int getFileMode() Get the file mode.- Returns:
- int
- Since:
- Ant 1.9.5
 
 - 
setDirModepublic void setDirMode(int dirMode) Set the dir mode, defaults to 0755.- Parameters:
- dirMode- int
- Since:
- Ant 1.9.5
 
 - 
getDirModepublic int getDirMode() Get the dir mode.- Returns:
- int
- Since:
- Ant 1.9.5
 
 - 
getPreserveLastModifiedpublic boolean getPreserveLastModified() Whether to preserve the last modified time.- Returns:
- boolean
- Since:
- Ant 1.9.7
 
 
- 
 
-