Class DirectoryOperation

java.lang.Object
com.sshtools.client.sftp.DirectoryOperation

public class DirectoryOperation extends Object

This class provides a list of operations that have been/or will be completed by the SftpClient's copyRemoteDirectory/copyLocalDirectory methods.

The objects returned could either be com.sshtools.client.sftp.maverick.sftp.SftpFile or java.io.File depending upon the commit state and whether syncronization is required. Any code using the values returned should be able to handle both types of file object.

  • Constructor Details

    • DirectoryOperation

      public DirectoryOperation()
      Construct a new directory operation object
  • Method Details

    • getNewFiles

      public Vector getNewFiles()
      Returns a list of new files that will be transfered in the directory operation
      Returns:
      Vector
    • getUpdatedFiles

      public Vector getUpdatedFiles()
      Returns a list of files that will be updated in the directory operation
      Returns:
      Vector
    • getUnchangedFiles

      public Vector getUnchangedFiles()
      Returns the list of files that will not be changed during the directory operation
      Returns:
      Vector
    • getDeletedFiles

      public Vector getDeletedFiles()
      When synchronizing directories, this method will return a list of files that will be deleted becasue they no longer exist at the source location.
      Returns:
      Vector
    • getFailedTransfers

      public Hashtable getFailedTransfers()
      Returns a Hashtable of files and exceptions.
      Returns:
      Vector
    • containsFile

      public boolean containsFile(com.sshtools.common.files.AbstractFile f)
      Determine whether the operation contains a file.
      Parameters:
      f -
      Returns:
      boolean
    • containsFile

      public boolean containsFile(SftpFile f)
      Determine whether the directory operation contains an SftpFile
      Parameters:
      f -
      Returns:
      boolean
    • addDirectoryOperation

      public void addDirectoryOperation(DirectoryOperation op, com.sshtools.common.files.AbstractFile f)
      Add the contents of another directory operation. This is used to record changes when recuring through directories.
      Parameters:
      op -
      f -
    • getFileCount

      public int getFileCount()
      Get the total number of new and changed files to transfer
      Returns:
      int
    • addDirectoryOperation

      public void addDirectoryOperation(DirectoryOperation op, String file)
      Add the contents of another directory operation. This is used to record changes when recuring through directories.
      Parameters:
      op -
      file -
    • getTransferSize

      public long getTransferSize() throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, IOException, com.sshtools.common.permissions.PermissionDeniedException
      Get the total number of bytes that this operation will transfer
      Returns:
      long
      Throws:
      IOException
      com.sshtools.common.permissions.PermissionDeniedException
      com.sshtools.common.sftp.SftpStatusException
      com.sshtools.common.ssh.SshException