| java.lang.Object org.apache.ivy.plugins.repository.ssh.Scp
Scp | public class Scp (Code) | | This class is using the scp client to transfer data and information for the repository.
It is based on the SCPClient from the ganymed ssh library from Christian Plattner,
released under a BSD style license.
To minimize the dependency to the ssh library and because we needed some additional
functionality, we decided to copy'n'paste the single class rather than to inherit or
delegate it somehow.
Nevertheless credit should go to the original author.
|
Inner Class :public class FileInfo | |
Constructor Summary | |
public | Scp(Session session) |
Method Summary | |
public void | get(String remoteFile, String localTarget) Download a file from the remote server to a local file. | public void | get(String remoteFile, OutputStream localTarget) | public FileInfo | getFileinfo(String remoteFile) | public void | put(String localFile, String remoteTargetDirectory, String remoteName) Copy a local file to a remote directory, uses mode 0600 when creating the file on the remote
side. | public void | put(byte[] data, String remoteFileName, String remoteTargetDirectory) Create a remote file and copy the contents of the passed byte array into it. | 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. | public void | put(String localFile, String remoteTargetDir, String remoteTargetName, String mode) Copy a local file to a remote site, uses the specified mode when creating the file on the
remote side. |
Scp | public Scp(Session session)(Code) | | |
get | public void get(String remoteFile, String localTarget) throws IOException, RemoteScpException(Code) | | Download a file from the remote server to a local file.
Parameters: remoteFile - Path and name of the remote file. Parameters: localTarget - Local file where to store the data. throws: IOException - in case of network problems throws: RemoteScpException - in case of problems on the target system (connection ok) |
get | public void get(String remoteFile, OutputStream localTarget) throws IOException, RemoteScpException(Code) | | Download a file from the remote server into an OutputStream
Parameters: remoteFile - Path and name of the remote file. Parameters: localTarget - OutputStream to store the data. throws: IOException - in case of network problems throws: RemoteScpException - in case of problems on the target system (connection ok) |
getFileinfo | public FileInfo getFileinfo(String remoteFile) throws IOException, RemoteScpException(Code) | | Initiates an SCP sequence but stops after getting fileinformation header
Parameters: remoteFile - to get information for the file information got throws: IOException - in case of network problems throws: RemoteScpException - in case of problems on the target system (connection ok) |
put | public void put(String localFile, String remoteTargetDirectory, String remoteName) throws IOException, RemoteScpException(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 where the file has to end up (optional) Parameters: remoteName - target filename to use throws: IOException - in case of network problems throws: RemoteScpException - in case of problems on the target system (connection ok) |
put | public void put(byte[] data, String remoteFileName, String remoteTargetDirectory) throws IOException, RemoteScpException(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 where the file has to end up (optional) throws: IOException - in case of network problems throws: RemoteScpException - in case of problems on the target system (connection ok) |
put | public void put(byte[] data, String remoteFileName, String remoteTargetDirectory, String mode) throws IOException, RemoteScpException(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 where the file has to end up (optional) Parameters: mode - a four digit string (e.g., 0644, see "man chmod", "man open") throws: IOException - in case of network problems throws: RemoteScpException - in case of problems on the target system (connection ok) |
put | public void put(String localFile, String remoteTargetDir, String remoteTargetName, String mode) throws IOException, RemoteScpException(Code) | | Copy a local file to a remote site, uses the specified mode when creating the file on the
remote side.
Parameters: localFile - Path and name of local file. Parameters: remoteTargetDir - Remote target directory where the file has to end up (optional) Parameters: remoteTargetName - file name to use on the target system Parameters: mode - a four digit string (e.g., 0644, see "man chmod", "man open") throws: IOException - in case of network problems throws: RemoteScpException - in case of problems on the target system (connection ok) |
|
|