org.apache.tools.ant.taskdefs.optional.ssh

## 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

    public class ScpToMessageBySftp
    extends ScpToMessage

Utility class to carry out an upload by sftp.

### Constructor Summary

Constructors
Constructor and Description
`ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath)` Constructor for a local file to remote.
`ScpToMessageBySftp(boolean verbose, com.jcraft.jsch.Session session, java.util.List aDirectoryList, java.lang.String aRemotePath)` Constructor for a local directories to remote.
`ScpToMessageBySftp(com.jcraft.jsch.Session session, java.io.File aLocalFile, java.lang.String aRemotePath)` Constructor for ScpToMessage.
`ScpToMessageBySftp(com.jcraft.jsch.Session session, java.util.List aDirectoryList, java.lang.String aRemotePath)` Constructor for ScpToMessage.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `execute()` Carry out the transfer.
`java.io.File` `getLocalFile()` Get the local file.
`java.lang.String` `getRemotePath()` Get the remote path.

### Methods inherited from class org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessage

`getDirMode, getFileMode, getPreserveLastModified, setDirMode, setFileMode`

### Methods inherited from class org.apache.tools.ant.taskdefs.optional.ssh.AbstractSshMessage

`getCompressed, getProgressMonitor, getVerbose, log, logStats, openExecChannel, openSftpChannel, sendAck, setLogListener, trackProgress, waitForAck`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ScpToMessageBySftp

    public ScpToMessageBySftp(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.7

#### ScpToMessageBySftp

    public ScpToMessageBySftp(boolean verbose,
                              com.jcraft.jsch.Session session,
                              java.util.List 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.7

#### ScpToMessageBySftp

    public ScpToMessageBySftp(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

#### ScpToMessageBySftp

    public ScpToMessageBySftp(com.jcraft.jsch.Session session,
                              java.util.List 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

#### execute

    public void execute()
                 throws java.io.IOException,
                        com.jcraft.jsch.JSchException

Carry out the transfer.

Overrides:
  `execute` in class `ScpToMessage`
Throws:
  `java.io.IOException` - on i/o errors
  `com.jcraft.jsch.JSchException` - on errors detected by scp

#### getLocalFile

    public java.io.File getLocalFile()

Get the local file.

Overrides:
  `getLocalFile` in class `ScpToMessage`
Returns:
  the local file.

#### getRemotePath

    public java.lang.String getRemotePath()

Get the remote path.

Overrides:
  `getRemotePath` in class `ScpToMessage`
Returns:
  the remote path.