本文整理匯總了Java中com.amazonaws.services.s3.model.Bucket.setOwner方法的典型用法代碼示例。如果您正苦於以下問題:Java Bucket.setOwner方法的具體用法?Java Bucket.setOwner怎麽用?Java Bucket.setOwner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.amazonaws.services.s3.model.Bucket
的用法示例。
在下文中一共展示了Bucket.setOwner方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: listBuckets
import com.amazonaws.services.s3.model.Bucket; //導入方法依賴的package包/類
@Override
public List<Bucket> listBuckets() throws AmazonClientException, AmazonServiceException {
ArrayList<Bucket> list = new ArrayList<Bucket>();
Bucket bucket = new Bucket("camel-bucket");
bucket.setOwner(new Owner("Camel", "camel"));
bucket.setCreationDate(new Date());
list.add(bucket);
return list;
}
示例2: createBucket
import com.amazonaws.services.s3.model.Bucket; //導入方法依賴的package包/類
@Override
public Bucket createBucket(CreateBucketRequest createBucketRequest) throws AmazonClientException, AmazonServiceException {
if ("nonExistingBucket".equals(createBucketRequest.getBucketName())) {
nonExistingBucketCreated = true;
}
Bucket bucket = new Bucket();
bucket.setName(createBucketRequest.getBucketName());
bucket.setCreationDate(new Date());
bucket.setOwner(new Owner("c2efc7302b9011ba9a78a92ac5fd1cd47b61790499ab5ddf5a37c31f0638a8fc ", "Christian Mueller"));
return bucket;
}