Wednesday, December 05, 2007

SCP using java api

same as SFTP example except use ScpClient in place of SFTPClient


ScpClient client = ssh.openScpClient();

// Open the SCP channel
String localFile = "localPath";
String remoteFile = "remotePath";

//
//get method signature
//public void get(java.lang.String localFile,
// java.lang.String remoteFile,
// boolean recursive,
// FileTransferProgress progress)
// throws SshException,
// ChannelOpenException
//

client.get(localFile,remoteFile,true);




syntax highlighted by Code2HTML, v. 0.9.1

No comments: