Skip to content

Commit

Permalink
Ensure empty tag set is provided
Browse files Browse the repository at this point in the history
Need to specify when using 'x-amz-tagging-directive=REPLACE'

See documentation here: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html#API_CopyObject_RequestParameters
  • Loading branch information
TomJKing committed Nov 19, 2024
1 parent 990bdcc commit aa496cd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.circe.syntax._
import io.circe.{Json, JsonObject, Printer}
import software.amazon.awssdk.core.sync.RequestBody
import software.amazon.awssdk.services.s3.S3Client
import software.amazon.awssdk.services.s3.model.{CopyObjectRequest, ListObjectsV2Request, PutObjectRequest, S3Object, TaggingDirective}
import software.amazon.awssdk.services.s3.model.{CopyObjectRequest, ListObjectsV2Request, PutObjectRequest, S3Object, Tagging, TaggingDirective}
import uk.gov.nationalarchives.`export`.Main.Config
import uk.gov.nationalarchives.`export`.MetadataUtils.{ConsignmentType, Judgment, Metadata, Standard}
import uk.gov.nationalarchives.`export`.S3Utils.FileOutput
Expand Down Expand Up @@ -53,6 +53,7 @@ class S3Utils(config: Config, s3Client: S3Client) {
.destinationKey(destinationKey)
.destinationBucket(destinationBucket)
.taggingDirective(TaggingDirective.REPLACE)
.tagging(Tagging.builder().build())
.build()
s3Client.copyObject(copyRequest)
val series = consignmentMetadata.find(_.propertyName == "Series").map(_.value)
Expand Down

0 comments on commit aa496cd

Please sign in to comment.