我使用了“SCP”方法“下载()”。但是,此方法是文件下载。我想知道那个文件夹下载...请回答我..谢谢。
//例子
private boolean readFolderSCP(String localFolder, String remoteFolder)
{
ssh.authPassword(param.getUsername(), param.getPasswd());
File scpfile = new File(remoteFolder);
if (scpfile.isDirectory())
{
String scpfiles[] = scpfile.list();
for (int i=0; i<scpfiles.length; i++)
{
File remotefile = new File(remoteFolder+"/"+scpfiles[i]);
if (remotefile.isFile())
{
ssh.newSCPFileTransfer().download(remoteFolder+"/"+scpfiles[i], new FileSystemFile(localFolder+"/"+scpfiles[i]));
}
}
}
return true;
}
这是正确的?