mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
Fix bug, when bucketname contains .
This commit is contained in:
+2
-2
@@ -70,7 +70,8 @@ public class AmazonS3FileStorageServiceImpl implements FileStorageService {
|
||||
|
||||
private static URI getUri(String key) {
|
||||
try {
|
||||
return new URI(retrievalProtocol, bucketName + "." + baseUrl, "/" + key, null);
|
||||
// FIXME: region is missing s3-... see: http://stackoverflow.com/questions/10975475/amazon-s3-upload-file-and-get-url
|
||||
return new URI(retrievalProtocol, baseUrl + "/" + bucketName, "/" + key, null);
|
||||
} catch (URISyntaxException e) {
|
||||
logger.log(Level.WARNING, "Could not create URI for uploaded file with key " + key, e);
|
||||
return null;
|
||||
@@ -97,5 +98,4 @@ public class AmazonS3FileStorageServiceImpl implements FileStorageService {
|
||||
s3.deleteObject(new DeleteObjectRequest(bucketName, key));
|
||||
logger.info("Removed file " + uri);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user