Fix UpYun oss (#241)

Fix UpYun oss
pull/248/head
Ryan Wang 2019-07-13 20:27:17 +08:00 committed by GitHub
commit 954dfd6415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -100,7 +100,7 @@ public class UpYunFileHandler implements FileHandler {
Assert.notNull(key, "File key must not be blank");
// Get config
String ossSource = optionService.getByPropertyOfNonNull(UpYunProperties.OSS_SOURCE).toString();
// String ossSource = optionService.getByPropertyOfNonNull(UpYunProperties.OSS_SOURCE).toString();
String ossPassword = optionService.getByPropertyOfNonNull(UpYunProperties.OSS_PASSWORD).toString();
String ossBucket = optionService.getByPropertyOfNonNull(UpYunProperties.OSS_BUCKET).toString();
String ossOperator = optionService.getByPropertyOfNonNull(UpYunProperties.OSS_OPERATOR).toString();
@ -111,11 +111,10 @@ public class UpYunFileHandler implements FileHandler {
upYun.setApiDomain(UpYun.ED_AUTO);
try {
String filePath = ossSource + key;
// Delete the file
boolean deleteResult = upYun.deleteFile(filePath);
boolean deleteResult = upYun.deleteFile(key);
if (!deleteResult) {
log.warn("Failed to delete file " + filePath + " from UpYun");
log.warn("Failed to delete file " + key + " from UpYun");
}
} catch (Exception e) {
throw new FileOperationException("附件从又拍云删除失败", e);