I need to update the cache control header in all AmazonS3's Cloud Files. However, I can't figure out how I do that using the jclouds API. I'm using apache jclouds plugin. And I got two related answers:
The first answer is suggesting to use SwiftKey Api class which is not available in grails's jcloud plugin. The second answer is using AWS java sdk for which there is already a grails wrapping plugin https://grails.org/plugin/aws-sdk but it doesn't support metadata update.
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . Navigate to your Amazon S3 bucket or folder, and select the check box to the left of the names of the objects with metadata you want to edit. On the Actions menu, choose Edit actions, and choose Edit metadata.
It's not possible to append to an existing file on AWS S3. You can delete existing file and upload new file with same name.
You can use the S3 Versioning feature to preserve, retrieve, and restore every version of every object stored in your buckets.
It is possible to change the metadata by performing an object copy (see How to update metadata using Amazon S3 SDK):
ObjectMetadata metadataCopy = new ObjectMetadata(); // copy previous metadata metadataCopy.addUserMetadata("newmetadata", "newmetadatavalue"); CopyObjectRequest request = new CopyObjectRequest(bucketName, existingKey, bucketName, existingKey) .withNewObjectMetadata(metadataCopy); amazonS3Client.copyObject(request);
Whether this is philosophically an "update" is up to you to decide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With