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 May 23, 2024
1 parent 2e4262b commit e9dcf87
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ implementation 'com.google.cloud:google-cloud-storage'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-storage:2.38.0'
implementation 'com.google.cloud:google-cloud-storage:2.39.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.38.0"
libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.39.0"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -349,6 +349,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-storage/tree/
| Delete Hmac Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/DeleteHmacKey.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/hmac/DeleteHmacKey.java) |
| Get Hmac Key | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/GetHmacKey.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/hmac/GetHmacKey.java) |
| List Hmac Keys | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/hmac/ListHmacKeys.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/hmac/ListHmacKeys.java) |
| Create Managed Folder | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/managedfolders/CreateManagedFolder.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/managedfolders/CreateManagedFolder.java) |
| Delete Managed Folder | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/managedfolders/DeleteManagedFolder.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/managedfolders/DeleteManagedFolder.java) |
| Get Managed Folder | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/managedfolders/GetManagedFolder.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/managedfolders/GetManagedFolder.java) |
| List Managed Folders | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/managedfolders/ListManagedFolders.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/managedfolders/ListManagedFolders.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) |
| Batch Set Object Metadata | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/BatchSetObjectMetadata.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/BatchSetObjectMetadata.java) |
| Change Object Csek To Kms | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ChangeObjectCsekToKms.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/ChangeObjectCsekToKms.java) |
Expand Down Expand Up @@ -494,7 +498,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-storage.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.38.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.39.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
import com.google.storage.control.v2.StorageControlClient;

class CreateManagedFolder {
public static void managedFolderCreate(String bucketName,
String managedFolderName, String managedFolderId) throws Exception {
public static void managedFolderCreate(
String bucketName, String managedFolderName, String managedFolderId) throws Exception {

// Instantiates a client in a try-with-resource to automatically cleanup underlying resources
try (StorageControlClient storageControlClient = StorageControlClient.create()) {
ManagedFolder managedFolder = ManagedFolder.newBuilder().setName(managedFolderName).build();
ManagedFolder response = storageControlClient.createManagedFolder(bucketName, managedFolder, managedFolderId);
ManagedFolder response =
storageControlClient.createManagedFolder(bucketName, managedFolder, managedFolderId);
System.out.printf("Created Managed Folder %s", response.getName());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.example.storage.managedfolders;
// [START storage_control_managed_folder_delete]

import com.google.storage.control.v2.ManagedFolder;
import com.google.storage.control.v2.StorageControlClient;

class DeleteManagedFolder {
Expand All @@ -28,7 +27,6 @@ public static void managedFolderDelete(String managedFolderName) throws Exceptio
System.out.printf("Deleted Managed Folder %s", managedFolderName);
}
}

}

// [END storage_control_managed_folder_delete]
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public static void managedFolderGet(String managedFolderName) throws Exception {
System.out.printf("Got Managed Folder %s", managedFolder.getName());
}
}

}

// [END storage_control_managed_folder_get]
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ class ListManagedFolders {
public static void managedFolderList(String bucketName) throws Exception {
// Instantiates a client in a try-with-resource to automatically cleanup underlying resources
try (StorageControlClient storageControlClient = StorageControlClient.create()) {
Iterable<ManagedFolder> managedFolders = storageControlClient
.listManagedFolders(bucketName)
.iterateAll();
for(ManagedFolder folder : managedFolders) {
Iterable<ManagedFolder> managedFolders =
storageControlClient.listManagedFolders(bucketName).iterateAll();
for (ManagedFolder folder : managedFolders) {
System.out.printf("%s bucket has managed folder %s", bucketName, folder.getName());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ public void testCreateManagedFolder() throws Exception {
assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(managedFolderName);
}
}

0 comments on commit e9dcf87

Please sign in to comment.