com.sshtools.sftp
Class DirectoryOperation

java.lang.Object
  extended bycom.sshtools.sftp.DirectoryOperation

public class DirectoryOperation
extends java.lang.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 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.

Author:
Lee David Painter

Constructor Summary
DirectoryOperation()
          Construct a new directory operation object
 
Method Summary
 void addDirectoryOperation(DirectoryOperation op, java.io.File f)
          Add the contents of another directory operation.
 void addDirectoryOperation(DirectoryOperation op, java.lang.String file)
          Add the contents of another directory operation.
 boolean containsFile(java.io.File f)
          Determine whether the operation contains a file.
 boolean containsFile(SftpFile f)
          Determine whether the directory operation contains an SftpFile
 java.util.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.
 java.util.Hashtable getFailedTransfers()
          Returns a Hashtable of files and exceptions.
 int getFileCount()
          Get the total number of new and changed files to transfer
 java.util.Vector getNewFiles()
          Returns a list of new files that will be transfered in the directory operation
 long getTransferSize()
          Get the total number of bytes that this operation will transfer
 java.util.Vector getUnchangedFiles()
          Returns the list of files that will not be changed during the directory operation
 java.util.Vector getUpdatedFiles()
          Returns a list of files that will be updated in the directory operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryOperation

public DirectoryOperation()
Construct a new directory operation object

Method Detail

getNewFiles

public java.util.Vector getNewFiles()
Returns a list of new files that will be transfered in the directory operation

Returns:

getUpdatedFiles

public java.util.Vector getUpdatedFiles()
Returns a list of files that will be updated in the directory operation

Returns:

getUnchangedFiles

public java.util.Vector getUnchangedFiles()
Returns the list of files that will not be changed during the directory operation

Returns:

getDeletedFiles

public java.util.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:

getFailedTransfers

public java.util.Hashtable getFailedTransfers()
Returns a Hashtable of files and exceptions.

Returns:
Vector

containsFile

public boolean containsFile(java.io.File f)
Determine whether the operation contains a file.

Parameters:
f -
Returns:

containsFile

public boolean containsFile(SftpFile f)
Determine whether the directory operation contains an SftpFile

Parameters:
f -
Returns:

addDirectoryOperation

public void addDirectoryOperation(DirectoryOperation op,
                                  java.io.File 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:

addDirectoryOperation

public void addDirectoryOperation(DirectoryOperation op,
                                  java.lang.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 SftpStatusException,
                            SshException
Get the total number of bytes that this operation will transfer

Returns:
Throws:
SftpStatusException
SshException


Copyright © 2003 3SP LTD. All Rights Reserved.