Resolved Conflicts

This commit is contained in:
Piyush
2025-01-21 14:40:23 +05:30
15 changed files with 114 additions and 16 deletions

View File

@@ -153,11 +153,17 @@ public class AmazonS3ServiceImpl implements AmazonS3Service {
}
}
private String decodeS3Key(String key) {
return URLDecoder.decode(key, StandardCharsets.UTF_8);
}
@Override
public UploadFileOnAmazonS3Response moveFile(String fileName, String oldPath, String newPath) {
try {
log.info("Original Paths - oldPath: {}, newPath: {}", oldPath, newPath);
oldPath = decodeS3Key(cleanOldPath(oldPath));
newPath = cleanNewPath(oldPath, newPath);
oldPath = cleanOldPath(oldPath);
log.info("Moving file from {} to {} in bucket {}", oldPath, newPath, bucketName);
CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, oldPath, bucketName, newPath);