| java.lang.Object ch.ethz.ssh2.SCPClient
SCPClient | public class SCPClient (Code) | | A very basic SCPClient that can be used to copy files from/to
the SSH-2 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 .
author: Christian Plattner, plattner@inf.ethz.ch version: $Id: SCPClient.java,v 1.11 2006/08/02 11:57:12 cplattne Exp $ |
Inner Class :class LenNamePair | |
Method Summary | |
public void | get(String remoteFile, String localTargetDirectory) Download a file from the remote server to a local directory. | public void | get(String remoteFile, OutputStream target) Download a file from the remote server and pipe its contents into an OutputStream .
Please note that, to enable flexible usage of this method, the OutputStream will not
be closed nor flushed. | public void | get(String remoteFiles, String localTargetDirectory) Download a set of files from the remote server to a local directory. | public void | put(String localFile, String remoteTargetDirectory) Copy a local file to a remote directory, uses mode 0600 when creating
the file on the remote side.
Parameters: localFile - Path and name of local file. Parameters: remoteTargetDirectory - Remote target directory. | public void | put(String[] localFiles, String remoteTargetDirectory) Copy a set of local files to a remote directory, uses mode 0600 when
creating files on the remote side.
Parameters: localFiles - Paths and names of local file names. Parameters: remoteTargetDirectory - Remote target directory. | public void | put(String localFile, String remoteTargetDirectory, String mode) Copy a local file to a remote directory, uses the specified mode when
creating the file on the remote side.
Parameters: localFile - Path and name of local file. Parameters: remoteTargetDirectory - Remote target directory. | public void | put(String localFile, String remoteFileName, String remoteTargetDirectory, String mode) Copy a local file to a remote directory, uses the specified mode and remote filename
when creating the file on the remote side.
Parameters: localFile - Path and name of local file. Parameters: remoteFileName - The name of the file which will be created in the remote target directory. Parameters: remoteTargetDirectory - Remote target directory. | public void | put(byte[] data, String remoteFileName, String remoteTargetDirectory) Create a remote file and copy the contents of the passed byte array into it.
Uses mode 0600 for creating the remote file.
Parameters: data - the data to be copied into the remote file. Parameters: remoteFileName - The name of the file which will be created in the remote target directory. Parameters: remoteTargetDirectory - Remote target directory. | public void | put(byte[] data, String remoteFileName, String remoteTargetDirectory, String mode) Create a remote file and copy the contents of the passed byte array into it.
The method use the specified mode when creating the file on the remote side.
Parameters: data - the data to be copied into the remote file. Parameters: remoteFileName - The name of the file which will be created in the remote target directory. Parameters: remoteTargetDirectory - Remote target directory. | public void | put(String[] localFiles, String remoteTargetDirectory, String mode) Copy a set of local files to a remote directory, uses the specified mode
when creating the files on the remote side.
Parameters: localFiles - Paths and names of the local files. Parameters: remoteTargetDirectory - Remote target directory. | public void | put(String[] localFiles, String[] remoteFiles, String remoteTargetDirectory, String mode) |
get | public void get(String remoteFile, String localTargetDirectory) throws IOException(Code) | | Download a file from the remote server to a local directory.
Parameters: remoteFile - Path and name of the remote file. Parameters: localTargetDirectory - Local directory to put the downloaded file. throws: IOException - |
get | public void get(String remoteFile, OutputStream target) throws IOException(Code) | | Download a file from the remote server and pipe its contents into an OutputStream .
Please note that, to enable flexible usage of this method, the OutputStream will not
be closed nor flushed.
Parameters: remoteFile - Path and name of the remote file. Parameters: target - OutputStream where the contents of the file will be sent to. throws: IOException - |
get | public void get(String remoteFiles, String localTargetDirectory) throws IOException(Code) | | Download a set of files from the remote server to a local directory.
Parameters: remoteFiles - Paths and names of the remote files. Parameters: localTargetDirectory - Local directory to put the downloaded files. throws: IOException - |
put | public void put(String localFile, String remoteTargetDirectory) throws IOException(Code) | | Copy a local file to a remote directory, uses mode 0600 when creating
the file on the remote side.
Parameters: localFile - Path and name of local file. Parameters: remoteTargetDirectory - Remote target directory. Use an empty string to specify the default directory. throws: IOException - |
put | public void put(String[] localFiles, String remoteTargetDirectory) throws IOException(Code) | | Copy a set of local files to a remote directory, uses mode 0600 when
creating files on the remote side.
Parameters: localFiles - Paths and names of local file names. Parameters: remoteTargetDirectory - Remote target directory. Use an empty string to specify the default directory. throws: IOException - |
put | public void put(String localFile, String remoteTargetDirectory, String mode) throws IOException(Code) | | Copy a local file to a remote directory, uses the specified mode when
creating the file on the remote side.
Parameters: localFile - Path and name of local file. Parameters: remoteTargetDirectory - Remote target directory. Use an empty string to specify the default directory. Parameters: mode - a four digit string (e.g., 0644, see "man chmod", "man open") throws: IOException - |
put | public void put(String localFile, String remoteFileName, String remoteTargetDirectory, String mode) throws IOException(Code) | | Copy a local file to a remote directory, uses the specified mode and remote filename
when creating the file on the remote side.
Parameters: localFile - Path and name of local file. Parameters: remoteFileName - The name of the file which will be created in the remote target directory. Parameters: remoteTargetDirectory - Remote target directory. Use an empty string to specify the default directory. Parameters: mode - a four digit string (e.g., 0644, see "man chmod", "man open") throws: IOException - |
put | public void put(byte[] data, String remoteFileName, String remoteTargetDirectory) throws IOException(Code) | | Create a remote file and copy the contents of the passed byte array into it.
Uses mode 0600 for creating the remote file.
Parameters: data - the data to be copied into the remote file. Parameters: remoteFileName - The name of the file which will be created in the remote target directory. Parameters: remoteTargetDirectory - Remote target directory. Use an empty string to specify the default directory. throws: IOException - |
put | public void put(byte[] data, String remoteFileName, String remoteTargetDirectory, String mode) throws IOException(Code) | | Create a remote file and copy the contents of the passed byte array into it.
The method use the specified mode when creating the file on the remote side.
Parameters: data - the data to be copied into the remote file. Parameters: remoteFileName - The name of the file which will be created in the remote target directory. Parameters: remoteTargetDirectory - Remote target directory. Use an empty string to specify the default directory. Parameters: mode - a four digit string (e.g., 0644, see "man chmod", "man open") throws: IOException - |
put | public void put(String[] localFiles, String remoteTargetDirectory, String mode) throws IOException(Code) | | Copy a set of local files to a remote directory, uses the specified mode
when creating the files on the remote side.
Parameters: localFiles - Paths and names of the local files. Parameters: remoteTargetDirectory - Remote target directory. Use an empty string to specify the default directory. Parameters: mode - a four digit string (e.g., 0644, see "man chmod", "man open") throws: IOException - |
|
|