From a94764c55ac7f2295a268a4a5fbaff15e5ef0886 Mon Sep 17 00:00:00 2001 From: Marco Ziccardi Date: Wed, 7 Sep 2016 16:38:04 +0200 Subject: [PATCH] Update StorageExample class to use new ACL methods --- .../google/cloud/examples/storage/StorageExample.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java index dc8837a496dc..9d7548058b4f 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java @@ -582,7 +582,7 @@ public void run(Storage storage, Tuple params) { System.out.printf("Bucket %s does not exist%n", blobId.bucket()); return; } - bucket.toBuilder().acl(addAcl(bucket.acl(), acl)).build().update(); + acl = bucket.createAcl(acl); System.out.printf("Added ACL %s to bucket %s%n", acl, blobId.bucket()); } else { Blob blob = storage.get(blobId); @@ -590,16 +590,10 @@ public void run(Storage storage, Tuple params) { System.out.printf("Blob %s does not exist%n", blobId); return; } - blob.toBuilder().acl(addAcl(blob.acl(), acl)).build().update(); + acl = blob.createAcl(acl); System.out.printf("Added ACL %s to blob %s%n", acl, blobId); } } - - private static List addAcl(List acls, Acl newAcl) { - List newAcls = new LinkedList<>(acls); - newAcls.add(newAcl); - return newAcls; - } } /**