【发布时间】:2020-06-03 11:12:29
【问题描述】:
我尝试将一个文件从一个文件夹复制到同一个存储桶内的另一个文件夹。为了复制文件,我使用 CopyObjectRequest 类。但我不知道如何获得复制操作的进度? 所以请帮助我,我怎样才能得到复制操作的进度状态。
对于复制操作,我遵循这种方式-
try {
AmazonS3 s3Client =new AmazonS3Client(credentials,cc);
// Copy the object into a new object in the same bucket.
CopyObjectRequest copyObjRequest = new CopyObjectRequest(bucketName, sourceKey, "wedorias-new", "test/test111/logo.png"/*destinationKey*/);
s3Client.copyObject(copyObjRequest);
if (copyObjRequest.isRequesterPays()){
System.out.println("sadfbgnh==");
}
} catch (AmazonServiceException e) {
// The call was transmitted successfully, but Amazon S3 couldn't process
// it, so it returned an error response.
e.printStackTrace();
System.out.println("exception==!"+e.getErrorMessage());
System.out.println("exception==!"+e.getErrorCode());
System.out.println("exception==!"+e.getMessage());
} catch (Exception e) {
e.printStackTrace();
System.out.println("exception==!"+e.getMessage());
}
【问题讨论】:
标签: android amazon-web-services amazon-s3 aws-lambda