sftp 新增将本地文件或者文件夹同步上传到远程目录的方法

This commit is contained in:
bwcx_jzy 2021-07-19 17:31:11 +08:00
parent 0c730e249c
commit 3f84506b23

View File

@ -430,7 +430,7 @@ public class Sftp extends AbstractFtp {
* @param file 文件或者文件夹
* @param remotePath 远程路径
*/
public void syncPath(File file, String remotePath) {
public void syncUpload(File file, String remotePath) {
if (!FileUtil.exist(file)) {
return;
}
@ -442,9 +442,9 @@ public class Sftp extends AbstractFtp {
for (File fileItem : files) {
if (fileItem.isDirectory()) {
String mkdir = FileUtil.normalize(remotePath + "/" + fileItem.getName());
this.syncPath(fileItem, mkdir);
this.syncUpload(fileItem, mkdir);
} else {
this.syncPath(fileItem, remotePath);
this.syncUpload(fileItem, remotePath);
}
}
} else {