Skip to content

Commit

Permalink
chore(samples): review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWhitehead committed Jun 15, 2023
1 parent c0ba791 commit cfe6647
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@
public class QuickstartGrpcDpSample {
public static void main(String... args) throws Exception {

// Create an instance of options which will use the Google Cloud Storage gRPC API for all
// operations
StorageOptions options = StorageOptions.grpc().setAttemptDirectPath(true).build();

// Instantiates a client in a try-with-resource to automatically cleanup underlying resources
try (Storage storage = options.getService()) {
// The name for the new bucket
String bucketName = args[0]; // "my-new-bucket";

// Creates the new bucket
// Creates the new bucket using a request to the gRPC API
Bucket bucket = storage.create(BucketInfo.of(bucketName));

System.out.printf("Bucket %s created.%n", bucket.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@
public class QuickstartGrpcSample {
public static void main(String... args) throws Exception {

// Create an instance of options which will use the Google Cloud Storage gRPC API for all
// operations
StorageOptions options = StorageOptions.grpc().build();

// Instantiates a client in a try-with-resource to automatically cleanup underlying resources
try (Storage storage = options.getService()) {
// The name for the new bucket
String bucketName = args[0]; // "my-new-bucket";

// Creates the new bucket
// Creates the new bucket using a request to the gRPC API
Bucket bucket = storage.create(BucketInfo.of(bucketName));

System.out.printf("Bucket %s created.%n", bucket.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public class QuickstartSampleIT {

private String bucketName;

private static final void deleteBucket(String bucketName) {
private static void deleteBucket(String bucketName) {
Storage storage = StorageOptions.getDefaultInstance().getService();
storage.delete(bucketName);
}

@Before
public void setUp() {
bucketName = "my-new-bucket-" + UUID.randomUUID().toString();
bucketName = "my-new-bucket-" + UUID.randomUUID();
}

@After
Expand Down

0 comments on commit cfe6647

Please sign in to comment.