StorageSample { public static Bucket getBucket(String bucketName) throws IOException, GeneralSecurityException { Storage client = StorageFactory.getService(); Storage.Buckets.Get bucketRequest = client.buckets().get(bucketName); bucketRequest.setProjection("full"); return bucketRequest.execute(); }  static List<StorageObject> listBucket(String bucketName); static Bucket getBucket(String bucketName); static void uploadFile(String name, String contentType, File file, String bucketName); static void deleteObject(String path, String bucketName); static void main(String[] args);  }
@Test public void testGetBucket() throws Exception { Bucket bucket = StorageSample.getBucket(BUCKET); assertWithMessage("bucket name").that(bucket.getName()).isEqualTo(BUCKET); assertWithMessage("bucket location").that(bucket.getLocation()).startsWith("US"); }