Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
proper S3 object handling (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr authored May 30, 2019
1 parent 76fae63 commit f8b8533
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=2.2.15
version=2.2.16
awsJavaSdkVersion=1.11.500
awsKinesisClientVersion=1.8.5
gradleWrapperVersion=3.4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,11 @@ class AmazonS3Service implements InitializingBean {
String destinationBucketName,
String destinationKey
) {
S3Object object
try {
CopyObjectRequest request = new CopyObjectRequest(sourceBucketName, sourceKey, destinationBucketName, destinationKey)

S3Object object = client.getObject(sourceBucketName, sourceKey)
object = client.getObject(sourceBucketName, sourceKey)

if (object.taggingCount) {
GetObjectTaggingRequest taggingRequest = new GetObjectTaggingRequest(sourceBucketName, sourceKey)
Expand All @@ -494,6 +495,8 @@ class AmazonS3Service implements InitializingBean {
} catch (AmazonClientException e) {
log.error("Exception moving object $sourceBucketName/$sourceKey to $destinationBucketName/$destinationKey", e)
return null
} finally {
object?.close()
}
}

Expand Down

0 comments on commit f8b8533

Please sign in to comment.