[英]How to get S3 URL for the object from S3 bucket using aws-sdk-2.x
We were using the AWS Java SDK-1.x version in our application till now.到目前为止,我们在我们的应用程序中使用的是 AWS Java SDK-1.x 版本。 We decided to migrate to the 2.x.
我们决定迁移到 2.x。 As per my analysis I have found out the equivalent function which we are using for 1.x client operation in 2.x in our application.
根据我的分析,我发现了等效的 function,我们在应用程序中将其用于 2.x 中的 1.x 客户端操作。 But for some operation I could not able to find matching functions.
但是对于某些操作,我找不到匹配的函数。 Below are the details.
以下是详细信息。
1.x (AmazonS3) ![]() |
2.x (S3AsyncClient) ![]() |
---|---|
getObject(String bucket, String key) ![]() |
getObject(GetObjectRequest req, Path destination) ![]() |
putObject(String bucket, String key, File file) ![]() |
putObject(PutObjectRequest req, Path source) ![]() |
generatePresignedUrl(GeneratePresignedUrlRequest req) ![]() |
S3PreSigner.presignGetObject(GetObjectPresignRequest req) ![]() |
deleteObject(String bucket, String key) ![]() |
deleteObject(DeleteObjectRequest req) ![]() |
getUrl(String bucket, String key) ![]() |
? ![]() |
doesObjectExist(String bucket, String key) ![]() |
? ![]() |
Any help or pointer is really appreciated.非常感谢任何帮助或指示。
Below are the replacements for the methods that you are looking for in 2.x SDK:以下是您在 2.x SDK 中寻找的方法的替代品:
1.11.x Operation ![]() |
2.0 Operation ![]() |
---|---|
getUrl |
S3Utilities#getUrl ![]() |
doesObjectExist |
headObject |
Here is a complete mapping of S3 1.x and 2.0 Operations .这是S3 1.x 和 2.0 操作的完整映射。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.