mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
sftp 新增将本地文件或者文件夹同步上传到远程目录的方法
This commit is contained in:
parent
0c730e249c
commit
3f84506b23
@ -430,7 +430,7 @@ public class Sftp extends AbstractFtp {
|
|||||||
* @param file 文件或者文件夹
|
* @param file 文件或者文件夹
|
||||||
* @param remotePath 远程路径
|
* @param remotePath 远程路径
|
||||||
*/
|
*/
|
||||||
public void syncPath(File file, String remotePath) {
|
public void syncUpload(File file, String remotePath) {
|
||||||
if (!FileUtil.exist(file)) {
|
if (!FileUtil.exist(file)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -442,9 +442,9 @@ public class Sftp extends AbstractFtp {
|
|||||||
for (File fileItem : files) {
|
for (File fileItem : files) {
|
||||||
if (fileItem.isDirectory()) {
|
if (fileItem.isDirectory()) {
|
||||||
String mkdir = FileUtil.normalize(remotePath + "/" + fileItem.getName());
|
String mkdir = FileUtil.normalize(remotePath + "/" + fileItem.getName());
|
||||||
this.syncPath(fileItem, mkdir);
|
this.syncUpload(fileItem, mkdir);
|
||||||
} else {
|
} else {
|
||||||
this.syncPath(fileItem, remotePath);
|
this.syncUpload(fileItem, remotePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user