代码拉取完成,页面将自动刷新
同步操作将从 Rainy/DocSys 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package com.DocSystem.test;
import com.DocSystem.common.Log;
import com.DocSystem.common.remoteStorage.SFTPUtil;
class SFTPUtilTest {
public static void main(String[] args) throws Exception {
SFTPUtil sftp = new SFTPUtil("ragao", "Rain_121902", "10.183.74.121", 22);
boolean ret = false;
for(int i=0; i < 3; i++)
{
ret = sftp.login();
if(ret == true)
{
break;
}
}
if(ret == false)
{
Log.debug("登录失败");
return;
}
//remote.SFTP.host = "10.183.74.121";
//remote.SFTP.port = 22;
//remote.SFTP.userName = "ragao";
//remote.SFTP.pwd = "Rain_121902";
//remote.SFTP.rootPath = "/var/fpwork/ragao/";
//remote.SFTP.host = "118.31.228.208";
//remote.SFTP.port = 2210;
//remote.SFTP.userName = "root";
//remote.SFTP.pwd = "Ahylkj20200701";
//remote.rootPath = "/mnt/SftpTest/";
String localRootPath = "C:/SFtpTestRootPath/";
String remoteRootPath = "/var/fpwork/ragao/";
//mkdir Test
if(sftp.mkdir(remoteRootPath + "SftpTestDir") == false)
{
Log.debug("目录 " + remoteRootPath + "SftpTestDir/ 创建失败");
}
else
{
Log.debug("目录 " + remoteRootPath + "SftpTestDir/ 创建成功");
}
//File upload Test
if(sftp.upload(remoteRootPath + "SftpTestDir/", localRootPath, "33333.txt") == false)
{
Log.debug("文件 " + remoteRootPath + "SftpTestDir/33333.txt 上传失败");
}
else
{
Log.debug("文件 " + remoteRootPath + "SftpTestDir/33333.txt 上传成功");
}
//File Copy Test
String srcRemotePath = "/var/fpwork/ragao/SftpTestDir/";
String dstRemotePath = "/var/fpwork/ragao/SftpTestDir/";
if(sftp.copy(srcRemotePath, "33333.txt", dstRemotePath, "444444.txt", 1) == false)
{
Log.debug("文件 " + remoteRootPath + "SftpTestDir/33333.txt 复制失败");
}
else
{
Log.debug("文件 " + remoteRootPath + "SftpTestDir/33333.txt 复制成功");
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。