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 TypeMethodDescriptionvoidAdd the contents of another directory operation.voidaddDirectoryOperation(DirectoryOperation op, String file) Add the contents of another directory operation.booleanDetermine whether the directory operation contains an SftpFilebooleanDetermine 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.intGet the total number of new and changed files to transferReturns a list of new files that will be transfered in the directory operationlongGet 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
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 SftpStatusException, SshException, IOException, PermissionDeniedExceptionGet the total number of bytes that this operation will transfer- Returns:
- long
- Throws:
IOExceptionPermissionDeniedExceptionSftpStatusExceptionSshException
-