Class ScpToMessageBySftp


public class ScpToMessageBySftp extends ScpToMessage
Utility class to carry out an upload by sftp.
  • Constructor Details

    • ScpToMessageBySftp

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

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

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

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

      public ScpToMessageBySftp(com.jcraft.jsch.Session session, File aLocalFile, 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, 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

    • execute

      public void execute() throws IOException, com.jcraft.jsch.JSchException
      Carry out the transfer.
      Overrides:
      execute in class ScpToMessage
      Throws:
      IOException - on i/o errors
      com.jcraft.jsch.JSchException - on errors detected by scp
    • getLocalFile

      public File getLocalFile()
      Get the local file.
      Overrides:
      getLocalFile in class ScpToMessage
      Returns:
      the local file.
    • getRemotePath

      public String getRemotePath()
      Get the remote path.
      Overrides:
      getRemotePath in class ScpToMessage
      Returns:
      the remote path.
    • getPreserveLastModified

      public boolean getPreserveLastModified()
      Returns true if the last modified time needs to be preserved on the file(s) that get transferred. Returns false otherwise.
      Overrides:
      getPreserveLastModified in class ScpToMessage
      Returns:
      boolean