|
@@ -115,7 +115,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
|
@Override
|
|
|
public void deleteFolder(String bucket, String remoteFolderPath) {
|
|
|
try {
|
|
|
- List<String> remoteFiles = listRemoteFiles(bucket, remoteFolderPath, false);
|
|
|
+ List<String> remoteFiles = listRemoteFiles(bucket, remoteFolderPath);
|
|
|
if (CollectionUtils.isEmpty(remoteFiles)) {
|
|
|
return;
|
|
|
}
|
|
@@ -139,13 +139,8 @@ public class OssFileService extends AbstractFYunFileService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public List<String> listRemoteFiles(String bucket, String sourcePath) {
|
|
|
- return listRemoteFiles(bucket, sourcePath, true);
|
|
|
- }
|
|
|
-
|
|
|
- private List<String> listRemoteFiles(String bucket, String sourcePath, Boolean shutdown) {
|
|
|
List<String> keyList = new ArrayList<>();
|
|
|
try {
|
|
|
boolean flag = true;
|
|
@@ -177,12 +172,8 @@ public class OssFileService extends AbstractFYunFileService {
|
|
|
|
|
|
@Override
|
|
|
public void copyFileBetweenBucket(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath) {
|
|
|
- copyFileBetweenBucket(sourceBucketName, sourcePath, targetBucketName, targetPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- private void copyFileBetweenBucket(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath, Boolean shutdown) {
|
|
|
try {
|
|
|
- List<String> files = listRemoteFiles(sourceBucketName, sourcePath, false);
|
|
|
+ List<String> files = listRemoteFiles(sourceBucketName, sourcePath);
|
|
|
if (ObjectUtils.isEmpty(files)) {
|
|
|
log.error("源文件夹为空:{}", sourcePath);
|
|
|
}
|
|
@@ -201,7 +192,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
|
}
|
|
|
try {
|
|
|
for (Map.Entry<String, String> entry : pathMap.entrySet()) {
|
|
|
- copyFileBetweenBucket(sourceBucketName, entry.getKey(), targetBucketName, entry.getValue(), false);
|
|
|
+ copyFileBetweenBucket(sourceBucketName, entry.getKey(), targetBucketName, entry.getValue());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("批量复制文件失败!");
|