SUPPORT-8566: fix PutObjectRequest key value
This commit is contained in:
parent
10abd45fbb
commit
a08441d8b0
1 changed files with 5 additions and 1 deletions
|
|
@ -46,8 +46,12 @@ public class S3Service {
|
|||
public void putFile(String filePath, String key) throws FileUploadException {
|
||||
PutObjectRequest objectRequest = PutObjectRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.key(key)
|
||||
.key(generateResourceName(bucketName, key))
|
||||
.build();
|
||||
s3Client.putObject(objectRequest, Paths.get(filePath));
|
||||
}
|
||||
|
||||
private static String generateResourceName(String bucketName, String key) {
|
||||
return String.join("/", bucketName, key);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue