1
我正在嘗試獲取aws-publicdatasets存儲桶中commoncrawl的對象名稱列表。我一直在尋找使用的JetS3t到createSignedGetUrl但我不知道我是否可以通過下面的方法獲取對象的列表:有沒有辦法在請求者支付標記的Amazon S3存儲桶中列出對象?
credentials = new AWSCredentials(accessId, secretId);
restS3Service = new RestS3Service(credentials);
restS3Service.setRequesterPaysEnabled(true);
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR, cal.get(Calendar.HOUR)+1);
Date expiryDate = new Date(cal.getTimeInMillis());
String getUrl = restS3Service.createSignedGetUrl(bucketName, null,
expiryDate, false);
S3Object obj = signedUrlHandler.getObjectWithSignedUrl(getUrl);