Due to the problem depicted here, I wish to update the content\mime type of already uploaded files. I am using JetS3t 0.9.0 to retrieve the object of interest, the I use Getting A File's Mime Type In Java to update the update the content\mime type, but I have no clue how to commit it on the object themselves, i.e. how to reflect it to the S3 storage.
Enclosed a snippet code, any help will be appreciated.
final String bucketName = "myBucketName";
final S3Bucket s3Bucket = s3Service.getBucket(bucketName);
final S3Object[] objects = s3Service.listObjects(bucketName);
String contentType = null;
for (S3Object object : objects) {
contentType = MimetypesFileTypeMap().getContentType(object.getName());
object.setContentType(contentType);
//how to commit the changes?
}
Thanks.