com.mindbright.sshcommon
Interface SSHFileTransfer

All Known Implementing Classes:
SSH2SFTPTransfer, SSHSCP1

public interface SSHFileTransfer

Common interface for all file transfer classes.


Method Summary
 void abort()
          Abort all operations
 void copyToLocal(java.lang.String localFile, java.lang.String[] remoteFiles, boolean recursive)
          Copy remote files to the local system.
 void copyToRemote(java.lang.String[] localFiles, java.lang.String remoteFile, boolean recursive)
          Copy local files to the server.
 void setProgress(SSHFileTransferProgress progress)
          Associate a SSHFileTransferProgress object with this file transfer object.
 

Method Detail

setProgress

public void setProgress(SSHFileTransferProgress progress)
Associate a SSHFileTransferProgress object with this file transfer object. The associated object will get reports on any transfer progress.

Parameters:
progress - Object which will get progress reports.

copyToRemote

public void copyToRemote(java.lang.String[] localFiles,
                         java.lang.String remoteFile,
                         boolean recursive)
                  throws java.io.IOException
Copy local files to the server. If the remoteFile parameter refers to a directory the all local files are placed into it. However it is kind of meaningless to specify multiple local files and one remote regular file since all files will be copied to the same name.

Parameters:
localFiles - Array of local files to copy.
remoteFile - Name to store file(s) as on server. If this is a directory then all files are copied to that directory.
recursive - If true recurse into directories and copy all files found. The directory structure is recreated on the server.
Throws:
java.io.IOException

copyToLocal

public void copyToLocal(java.lang.String localFile,
                        java.lang.String[] remoteFiles,
                        boolean recursive)
                 throws java.io.IOException
Copy remote files to the local system. If the localFile parameter refers to a directory the all remote files are placed into it. However it is kind of meaningless to specify multiple remote files and one local regular file since all files will be copied to the same name.

Parameters:
localFile - Name to store file(s) as locally. If this is a directory then all files are copied to that directory.
remoteFiles - Array of files to copy.
recursive - If true recurse into directories and copy all files found. The directory structure is recreated on the server.
Throws:
java.io.IOException

abort

public void abort()
Abort all operations