Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Feb 25, 2022
1 parent 14e437b commit 27e5770
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-storage/tree/
| Print Bucket Acl | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAcl.java) |
| Print Bucket Acl Filter By User | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/PrintBucketAclFilterByUser.java) |
| Remove Bucket Default Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/bucket/RemoveBucketDefaultOwner.java) |
| Add File Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java) |
| Remove File Owner | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java) |



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public static void addFileOwner(String bucketName, String userEmail, String blob

blob.createAcl(newOwner);
System.out.println(
"Added user " + userEmail + " as an owner on file " + blobName + " in bucket "
"Added user "
+ userEmail
+ " as an owner on file "
+ blobName
+ " in bucket "
+ bucketName);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ public static void removeFileOwner(String bucketName, String userEmail, String b
boolean success = blob.deleteAcl(ownerToRemove);
if (success) {
System.out.println(
"Removed user " + userEmail + " as an owner on file " + blobName + " in bucket "
"Removed user "
+ userEmail
+ " as an owner on file "
+ blobName
+ " in bucket "
+ bucketName);
} else {
System.out.println("User " + userEmail + " was not found");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public void testAddFileOwner() {
assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
assertThat(blob.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNotNull();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testRemoveFileOwner() {
// Make sure the User has Ownership permissions on the bucket.
Acl bucketOwner = Acl.of(new User(userEmail), Role.OWNER);
bucket.createAcl(newOwner);

// Add User as Owner
Acl newFileOwner = Acl.of(new User(IT_SERVICE_ACCOUNT_EMAIL), Role.OWNER);
blob.createAcl(newFileOwner);
Expand Down

0 comments on commit 27e5770

Please sign in to comment.