Package com.sshtools.client.sftp
Class DirectoryOperation
java.lang.Object
com.sshtools.client.sftp.DirectoryOperation
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDirectoryOperation
(DirectoryOperation op, com.sshtools.common.files.AbstractFile f) Add the contents of another directory operation.void
addDirectoryOperation
(DirectoryOperation op, String file) Add the contents of another directory operation.boolean
Determine whether the directory operation contains an SftpFileboolean
containsFile
(com.sshtools.common.files.AbstractFile f) Determine whether the operation contains a file.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 a Hashtable of files and exceptions.int
Get the total number of new and changed files to transferReturns a list of new files that will be transfered in the directory operationlong
Get the total number of bytes that this operation will transferReturns the list of files that will not be changed during the directory operationReturns a list of files that will be updated in the directory operation
-
Constructor Details
-
DirectoryOperation
public DirectoryOperation()Construct a new directory operation object
-
-
Method Details
-
getNewFiles
Returns a list of new files that will be transfered in the directory operation- Returns:
- Vector
-
getUpdatedFiles
Returns a list of files that will be updated in the directory operation- Returns:
- Vector
-
getUnchangedFiles
Returns the list of files that will not be changed during the directory operation- Returns:
- 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
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
Determine whether the directory operation contains an SftpFile- Parameters:
f
-- Returns:
- boolean
-
addDirectoryOperation
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
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.PermissionDeniedExceptionGet 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
-