最近更新时间:2021-09-18
桶(Bucket)是存储对象(Object)的容器。对象都隶属于桶。
以下代码用于创建桶:
public void testCreateBucket() { Bucket b = null; if (s3.doesBucketExistV2(bucketName)) { System.out.format("Bucket %s already exists.\n", bucketName); } else { try { s3.createBucket(bucketName); } catch (AmazonS3Exception e) { System.err.println(e.getErrorMessage()); } } System.out.println("Done!"); } |