|
|
@@ -33,7 +33,7 @@ public class ObjectMultipartUploadService {
|
|
|
private final Map<String, PathUrl> pathMap = new HashMap<>();
|
|
|
private final ObjectNameService objectNameService;
|
|
|
private final PutObjectService putObjectService;
|
|
|
- private final String domain;
|
|
|
+ private final StoreLocalCache storeLocalCache;
|
|
|
|
|
|
public ObjectMultipartUploadService(FileMetaMapper fileMetaMapper, FileStoreService fileStoreService,
|
|
|
ObjectNameService objectNameService, PutObjectService putObjectService,
|
|
|
@@ -42,7 +42,7 @@ public class ObjectMultipartUploadService {
|
|
|
this.fileStoreService = fileStoreService;
|
|
|
this.objectNameService = objectNameService;
|
|
|
this.putObjectService = putObjectService;
|
|
|
- this.domain = storeLocalCache.getDomain();
|
|
|
+ this.storeLocalCache = storeLocalCache;
|
|
|
}
|
|
|
|
|
|
public synchronized UploadPrepareRet prepareUpload(UploadPrepare uploadPrepare) {
|
|
|
@@ -52,7 +52,7 @@ public class ObjectMultipartUploadService {
|
|
|
return new UploadPrepareRet("uploadId", PART_SIZE, false, null);
|
|
|
} else {
|
|
|
String objectName = fileMeta.getObjectName();
|
|
|
- String url = String.format("https://%s/%s", domain, objectName);
|
|
|
+ String url = String.format("https://%s/%s", storeLocalCache.getDomain(), objectName);
|
|
|
return new UploadPrepareRet("uploadId", PART_SIZE, false, url);
|
|
|
}
|
|
|
}
|
|
|
@@ -83,7 +83,7 @@ public class ObjectMultipartUploadService {
|
|
|
ObjectProp objectProp = objectNameService.getObjectProp(objectChannel, suffix);
|
|
|
putObjectService.copyObject(objectProp, filename, fileMeta);
|
|
|
|
|
|
- String url = String.format("https://%s/%s", domain, objectProp);
|
|
|
+ String url = String.format("https://%s/%s", storeLocalCache.getDomain(), objectProp);
|
|
|
return new UploadFileRet(sha256sum, url);
|
|
|
}
|
|
|
|
|
|
@@ -125,7 +125,7 @@ public class ObjectMultipartUploadService {
|
|
|
|
|
|
map.remove(sha256sum);
|
|
|
pathMap.remove(sha256sum);
|
|
|
- String url = String.format("https://%s/%s", domain, objectProp);
|
|
|
+ String url = String.format("https://%s/%s", storeLocalCache.getDomain(), objectProp);
|
|
|
return new UploadFileRet(sha256sum, url);
|
|
|
}
|
|
|
}
|