ch.ethz.ssh2
Class SCPClient

java.lang.Object
  extended bych.ethz.ssh2.SCPClient

public class SCPClient
extends java.lang.Object

A very basic SCPClient that can be used to copy files from/to the SSH2 server. On the server side, the "scp" program must be in the PATH. This scp client is thread safe - you can download (and upload) different sets of files concurrently without any troubles. The SCPClient is actually mapping every request to a distinct Session.

Version:
$Id: SCPClient.java,v 1.2 2005/06/09 15:33:04 cplattne Exp $
Author:
Christian Plattner, plattner@inf.ethz.ch

Method Summary
 void get(java.lang.String[] remoteFiles, java.lang.String localTargetDirectory)
          Download a set of files from the remote server to a local directory.
 void get(java.lang.String remoteFile, java.lang.String localTargetDirectory)
          Download a file from the remote server to a local directory.
 void put(java.lang.String[] localFiles, java.lang.String remoteTargetDirectory)
          Copy a set of local files to a remote directory, uses umask 0600 when creating files on the remote side.
 void put(java.lang.String[] localFiles, java.lang.String remoteTargetDirectory, java.lang.String umask)
          Copy a set of local files to a remote directory, uses the specified umask when creating the files on the remote side.
 void put(java.lang.String localFile, java.lang.String remoteTargetDirectory)
          Copy a local file to a remote directory, uses umask 0600 when creating the file on the remote side.
 void put(java.lang.String localFile, java.lang.String remoteTargetDirectory, java.lang.String umask)
          Copy a local file to a remote directory, uses the specified umask when creating the file on the remote side.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

put

public void put(java.lang.String localFile,
                java.lang.String remoteTargetDirectory)
         throws java.io.IOException
Copy a local file to a remote directory, uses umask 0600 when creating the file on the remote side.

Parameters:
localFile - Path and name of local file.
remoteTargetDirectory - Remote target directory.
Throws:
java.io.IOException

put

public void put(java.lang.String[] localFiles,
                java.lang.String remoteTargetDirectory)
         throws java.io.IOException
Copy a set of local files to a remote directory, uses umask 0600 when creating files on the remote side.

Parameters:
localFiles - Paths and names of local file names.
remoteTargetDirectory - Remote target directory.
Throws:
java.io.IOException

put

public void put(java.lang.String localFile,
                java.lang.String remoteTargetDirectory,
                java.lang.String umask)
         throws java.io.IOException
Copy a local file to a remote directory, uses the specified umask when creating the file on the remote side.

Parameters:
localFile - Path and name of local file.
remoteTargetDirectory - Remote target directory.
umask - a four digit string (e.g., 0644)
Throws:
java.io.IOException

put

public void put(java.lang.String[] localFiles,
                java.lang.String remoteTargetDirectory,
                java.lang.String umask)
         throws java.io.IOException
Copy a set of local files to a remote directory, uses the specified umask when creating the files on the remote side.

Parameters:
localFiles - Paths and names of the local files.
remoteTargetDirectory - Remote target directory.
umask - a four digit string (e.g., 0644)
Throws:
java.io.IOException

get

public void get(java.lang.String remoteFile,
                java.lang.String localTargetDirectory)
         throws java.io.IOException
Download a file from the remote server to a local directory.

Parameters:
remoteFile - Path and name of the remote file.
localTargetDirectory - Local directory to put the downloaded file.
Throws:
java.io.IOException

get

public void get(java.lang.String[] remoteFiles,
                java.lang.String localTargetDirectory)
         throws java.io.IOException
Download a set of files from the remote server to a local directory.

Parameters:
remoteFiles - Paths and names of the remote files.
localTargetDirectory - Local directory to put the downloaded files.
Throws:
java.io.IOException