|
@@ -84,14 +84,16 @@ public class DataService {
|
|
String fileStorePath =getFileWithUrl(newUrl, fileName);
|
|
String fileStorePath =getFileWithUrl(newUrl, fileName);
|
|
File file =new File(fileStorePath);
|
|
File file =new File(fileStorePath);
|
|
String eTag = getFileMd5(file);
|
|
String eTag = getFileMd5(file);
|
|
- Boolean eBoolean = OSS_CLIENT.doesObjectExist(PropKit.get("oss_bucketName"), PropKit.get("institution_id")+"/"+eTag);
|
|
|
|
|
|
+ String key = PropKit.get("institution_id")+"/"+eTag;
|
|
|
|
+
|
|
|
|
+ Boolean eBoolean = OSS_CLIENT.doesObjectExist(PropKit.get("oss_bucketName"), key);
|
|
if (!eBoolean) {
|
|
if (!eBoolean) {
|
|
- OSS_CLIENT.putObject(PropKit.get("oss_bucketName"), PropKit.get("institution_id")+"/"+eTag, file);
|
|
|
|
- Boolean bBoolean = OSS_CLIENT.doesObjectExist(PropKit.get("oss_bucketName"), PropKit.get("institution_id")+"/"+eTag);
|
|
|
|
|
|
+ OSS_CLIENT.putObject(PropKit.get("oss_bucketName"), key, file);
|
|
|
|
+ Boolean bBoolean = OSS_CLIENT.doesObjectExist(PropKit.get("oss_bucketName"), key);
|
|
if (bBoolean) {
|
|
if (bBoolean) {
|
|
file.delete();
|
|
file.delete();
|
|
- map.put("url", "https://annex.oss.cn-north-3.inspurcloudoss.com/"+PropKit.get("institution_id")+"/"+eTag);
|
|
|
|
- map.put("name", eTag);
|
|
|
|
|
|
+ map.put("url", "https://annex.oss.cn-north-3.inspurcloudoss.com/"+key);
|
|
|
|
+ map.put("name", key);
|
|
postWithParameters(SAVE_ANNEX_URL, map);
|
|
postWithParameters(SAVE_ANNEX_URL, map);
|
|
}
|
|
}
|
|
}
|
|
}
|