最近更新时间:2021-09-18
以下代码用于列举所有的桶:
public void testBucketList() { try { List buckets = s3.listBuckets(); for (Bucket b : buckets) { System.out.println("* " + b.getName()); } }catch (AmazonS3Exception e) { System.err.println(e.getErrorMessage()); } System.out.println("Done!"); } |