Reputation: 29
I've recently updated my AWS Java SDK for version 2.0 and I'm having a hard time finding some examples. I need to generate a pre-signed URL object to access objects stored on S3. I took a look on https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURLJavaSDK.html but I couldn't find the same code example for version 2.0. Can anybody please help me?
Ps.: there are some examples at https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2 but none of them seems to solve my problem.
Regards, Luan
Upvotes: 1
Views: 884
Reputation: 1722
As far as I know this is not implemented yet in aws sdk v2.
In order to build the link you can execute a GetObject request with a dummy HTTP client and obtain all required information for signing from the sdk internals.
You can do this without doing real network call.
Here it is complete implementation - https://github.com/aaronanderson/jax-rs-aws-signerv4/
Upvotes: 1