Class GoogleCloudBucketOperations

java.lang.Object
io.micronaut.objectstorage.googlecloud.GoogleCloudBucketOperations
All Implemented Interfaces:
BucketOperations<com.google.cloud.storage.Bucket>

@EachBean(GoogleCloudStorageConfiguration.class) @Requires(condition=ToggeableCondition.class) @Requires(beans=GoogleCloudStorageConfiguration.class) public class GoogleCloudBucketOperations extends Object implements BucketOperations<com.google.cloud.storage.Bucket>
GCP bucket operations.
Since:
3.0.0
Author:
Álvaro Sánchez-Mariscal
  • Constructor Details

    • GoogleCloudBucketOperations

      public GoogleCloudBucketOperations(@Parameter GoogleCloudStorageConfiguration configuration, com.google.cloud.storage.Storage storage)
  • Method Details

    • create

      public void create(@NonNull String name)
      Description copied from interface: BucketOperations
      Create a new bucket with the given name.
      Specified by:
      create in interface BucketOperations<com.google.cloud.storage.Bucket>
      Parameters:
      name - The name of the new bucket
    • retrieve

      public Optional<BucketEntry<com.google.cloud.storage.Bucket>> retrieve(@NonNull String name)
      Description copied from interface: BucketOperations
      Retrieve an existing bucket/container.
      Specified by:
      retrieve in interface BucketOperations<com.google.cloud.storage.Bucket>
      Parameters:
      name - The name of the bucket
      Returns:
      The provider-native bucket/container data if it exists.
    • delete

      public void delete(@NonNull String name)
      Description copied from interface: BucketOperations
      Delete a bucket/container with the given name.
      Specified by:
      delete in interface BucketOperations<com.google.cloud.storage.Bucket>
      Parameters:
      name - The name of the bucket/container.