|
|
@@ -22,7 +22,9 @@ public class FileUrlService {
|
|
|
this.domain = dfsProperties.getDomain();
|
|
|
}
|
|
|
|
|
|
- public PathUrl genPathAndUrl(String sha256sum, String fileId, String suffix) throws IOException, NoSuchAlgorithmException {
|
|
|
+ @Deprecated
|
|
|
+ public PathUrl genPathAndUrl(String sha256sum, String fileId, String suffix)
|
|
|
+ throws IOException, NoSuchAlgorithmException {
|
|
|
String storeDir = loadBalancer.getStoreDir(0, sha256sum);
|
|
|
String filePath = String.format("%s/%s.%s", storeDir, fileId, suffix);
|
|
|
String path = String.format("video/%s.%s", fileId, suffix);
|
|
|
@@ -39,12 +41,12 @@ public class FileUrlService {
|
|
|
return new PathUrl(filePath, url, path);
|
|
|
}
|
|
|
|
|
|
- public PathUrl getImagePathAndUrl(String sha256sum, String fileId, String suffix, int width, int height)
|
|
|
- throws IOException, NoSuchAlgorithmException {
|
|
|
- String storeDir = loadBalancer.getStoreDir(0, sha256sum);
|
|
|
+ public PathUrl getImagePathAndUrl(String sha256sum, String uploadId, long fileSize, String fileId, String suffix,
|
|
|
+ int width, int height) throws IOException, NoSuchAlgorithmException {
|
|
|
+ String storeDir = loadBalancer.getStoreDir(fileSize, sha256sum);
|
|
|
String filePath = String.format("%s/%s_%sx%s.%s", storeDir, fileId, width, height, suffix);
|
|
|
- String path = String.format("video/%s.%s", fileId, suffix);
|
|
|
- String url = String.format("//%s/image/%s.%s", domain, fileId, suffix);
|
|
|
+ String path = String.format("video/%s.%s", uploadId, suffix);
|
|
|
+ String url = String.format("//%s/image/%s.%s", domain, uploadId, suffix);
|
|
|
return new PathUrl(filePath, url, path);
|
|
|
}
|
|
|
}
|