|
@@ -34,7 +34,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
try {
|
|
try {
|
|
ossClient.putObject(bucket, remoteFilePath, new ByteArrayInputStream(data));
|
|
ossClient.putObject(bucket, remoteFilePath, new ByteArrayInputStream(data));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("oss上传文件失败,remoteFilePath:" + remoteFilePath, e);
|
|
|
|
|
|
+ log.error("oss上传文件失败,remoteFilePath:" + remoteFilePath, e);
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -50,8 +50,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
ossClient.putObject(bucket, remoteFilePath, inputStream);
|
|
ossClient.putObject(bucket, remoteFilePath, inputStream);
|
|
log.info("文件流上传成功,目标路径:remoteFilePath:{}", remoteFilePath);
|
|
log.info("文件流上传成功,目标路径:remoteFilePath:{}", remoteFilePath);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("oss上传文件失败,remoteFilePath:"+remoteFilePath, e);
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
|
+ log.error("oss上传文件失败,remoteFilePath:"+remoteFilePath, e);
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -82,7 +81,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
ossClient.putObject(bucket, remoteFilePath, file, metadata);
|
|
ossClient.putObject(bucket, remoteFilePath, file, metadata);
|
|
log.info("文件上传成功,path:{}", filePath);
|
|
log.info("文件上传成功,path:{}", filePath);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("oss上传文件失败,filePath:"+filePath, e);
|
|
|
|
|
|
+ log.error("oss上传文件失败,filePath:"+filePath, e);
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -96,7 +95,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
callshell(command);
|
|
callshell(command);
|
|
log.info("上传文件完毕, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
log.info("上传文件完毕, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn(String.format("上传文件失败, ossPath:%s, srcPath:%s", remoteFilePath, filePath), e);
|
|
|
|
|
|
+ log.error(String.format("上传文件失败, ossPath:%s, srcPath:%s", remoteFilePath, filePath), e);
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -110,7 +109,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
callshell(command);
|
|
callshell(command);
|
|
log.info("下载文件完毕, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
log.info("下载文件完毕, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn(String.format("下载文件失败, ossPath:%s, srcPath:%s", remoteFilePath, filePath), e);
|
|
|
|
|
|
+ log.error(String.format("下载文件失败, ossPath:%s, srcPath:%s", remoteFilePath, filePath), e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -134,7 +133,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
request.setKeys(remoteFiles);
|
|
request.setKeys(remoteFiles);
|
|
ossClient.deleteObjects(request);
|
|
ossClient.deleteObjects(request);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("OSS删除文件失败,key:" + remoteFolderPath, e);
|
|
|
|
|
|
+ log.error("OSS删除文件失败,key:" + remoteFolderPath, e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -145,7 +144,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
uploadFile(bucket, entry.getKey(), entry.getValue(), null);
|
|
uploadFile(bucket, entry.getKey(), entry.getValue(), null);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("OSS批量上传文件失败!");
|
|
|
|
|
|
+ log.error("OSS批量上传文件失败!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -174,7 +173,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
flag = objectListing.isTruncated();
|
|
flag = objectListing.isTruncated();
|
|
} while (flag);
|
|
} while (flag);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("获取文件列表失败,path:" + sourcePath, e);
|
|
|
|
|
|
+ log.error("获取文件列表失败,path:" + sourcePath, e);
|
|
}
|
|
}
|
|
return keyList;
|
|
return keyList;
|
|
}
|
|
}
|
|
@@ -190,7 +189,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
ossClient.copyObject(sourceBucketName, file, targetBucketName, file.replace(sourcePath, targetPath));
|
|
ossClient.copyObject(sourceBucketName, file, targetBucketName, file.replace(sourcePath, targetPath));
|
|
});
|
|
});
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("列举文件目录失败,key:" + sourcePath, e);
|
|
|
|
|
|
+ log.error("列举文件目录失败,key:" + sourcePath, e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -204,7 +203,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
copyFileBetweenBucket(sourceBucketName, entry.getKey(), targetBucketName, entry.getValue());
|
|
copyFileBetweenBucket(sourceBucketName, entry.getKey(), targetBucketName, entry.getValue());
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn(String.format("批量复制文件失败, sourceBucketName:%s, targetBucketName:%s", sourceBucketName, targetBucketName), e);
|
|
|
|
|
|
+ log.error(String.format("批量复制文件失败, sourceBucketName:%s, targetBucketName:%s", sourceBucketName, targetBucketName), e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -224,7 +223,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
}
|
|
}
|
|
return contentJson.toString();
|
|
return contentJson.toString();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("获取文件内容失败:key:"+remoteFilePath, e);
|
|
|
|
|
|
+ log.error("获取文件内容失败:key:"+remoteFilePath, e);
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -234,7 +233,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
try {
|
|
try {
|
|
return ossClient.doesObjectExist(bucket, objectName);
|
|
return ossClient.doesObjectExist(bucket, objectName);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.warn("判断文件是否存在失败,key:"+objectName, e);
|
|
|
|
|
|
+ log.error("判断文件是否存在失败,key:"+objectName, e);
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -259,7 +258,7 @@ public class OssFileService extends AbstractFYunFileService {
|
|
request.setEnableCheckpoint(true);
|
|
request.setEnableCheckpoint(true);
|
|
ossClient.downloadFile(request);
|
|
ossClient.downloadFile(request);
|
|
} catch (Throwable throwable) {
|
|
} catch (Throwable throwable) {
|
|
- log.warn("文件下载失败,key:"+remoteFilePath, throwable);
|
|
|
|
|
|
+ log.error("文件下载失败,key:"+remoteFilePath, throwable);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|