New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 - Tagging S3 Objects using the TransferManager uploadDirectory is not possible with the current SDK. #1005

Closed
erbrito opened this Issue Jan 31, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@erbrito

erbrito commented Jan 31, 2017

Tagging S3 Objects using the TransferManager uploadDirectory is not possible with the current SDK. It would very nice and simple to implement a TransferManager with Tagging functionality with a ObjectTaggingProvider. In the same way it is implemented the ObjectMetadataProvider.

https://aws.amazon.com/blogs/developer/amazon-s3-transfermanager-batched-file-uploads/

http://docs.aws.amazon.com/AmazonS3/latest/dev/tagging-manage-javasdk.html

Please let me know how can I contribute to add this functionality and add a pull request with this solution.

@erbrito erbrito changed the title from S3 to S3 - Tagging S3 Objects using the TransferManager uploadDirectory is not possible with the current SDK. Jan 31, 2017

@dagnir dagnir self-assigned this Jan 31, 2017

@dagnir

This comment has been minimized.

Contributor

dagnir commented Jan 31, 2017

Hi @erbrito, yep you're right, it's not currently possible. Your suggestion of using providing a callback similar to ObjectMetadataProvider is probably the right way to go. We love pull requests so if you're interested in implementing this functionality and submitting one for it, i'd be happy to take a look. Here's the bit of code where the TransferManager makes a call back to the ObjectMetadataProvider:

for (File f : files) {
// Check, if file, since only files can be uploaded.
if (f.isFile()) {
totalSize += f.length();
String key = f.getAbsolutePath()
.substring(startingPosition)
.replaceAll("\\\\", "/");
ObjectMetadata metadata = new ObjectMetadata();
// Invoke the callback if it's present.
// The callback allows the user to customize the metadata
// for each file being uploaded.
if (metadataProvider != null) {
metadataProvider.provideObjectMetadata(f, metadata);
}
// All the single-file uploads share the same
// MultipleFileTransferProgressUpdatingListener and
// MultipleFileTransferStateChangeListener
uploads.add((UploadImpl) doUpload(
new PutObjectRequest(bucketName,
virtualDirectoryKeyPrefix + key, f)
.withMetadata(metadata)
.<PutObjectRequest> withGeneralProgressListener(
listener), transferListener, null, null));
}
}
. We would probably just want to do the same thing with a similar call back for tags.

@erbrito

This comment has been minimized.

erbrito commented Feb 2, 2017

I created the pull request #1011 Please let me know if there are some procedures or guidelines to follow.

@erbrito

This comment has been minimized.

erbrito commented Feb 13, 2017

Thanks @dagnir to add this feature. I just verified that is merged the pull request on the master branch.
Do you know in which release will be integrated 1.11.90?
and when it will released?

@dagnir

This comment has been minimized.

Contributor

dagnir commented Feb 13, 2017

Hey @erbrito I believe we have a release today.

@dagnir

This comment has been minimized.

Contributor

dagnir commented Feb 13, 2017

Looks like we're not having a release today after all. I'll update when I get another date, but it hopefully by the end of the week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment