public class

StorageClient

extends Object
java.lang.Object
   ↳ com.google.firebase.cloud.StorageClient

Class Overview

StorageClient provides access to Google Cloud Storage APIs. You can specify a default cloud storage bucket via FirebaseOptions, and then get a reference to this default bucket by calling bucket(). Or you can get a reference to a specific bucket at any time by calling bucket(String).

This class requires Google Cloud Storage libraries for Java. Make sure the artifact google-cloud-storage is in the classpath along with its transitive dependencies.

Summary

Public Methods
Bucket bucket()
Returns the default cloud storage bucket associated with the current app.
Bucket bucket(String name)
Returns a cloud storage Bucket instance for the specified bucket name.
synchronized static StorageClient getInstance(FirebaseApp app)
static StorageClient getInstance()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Bucket bucket ()

Returns the default cloud storage bucket associated with the current app. This is the bucket configured via FirebaseOptions when initializing the app. If no bucket was configured via options, this method throws an exception.

Returns
  • a cloud storage Bucket instance.
Throws
IllegalArgumentException If no bucket is configured via FirebaseOptions, or if the bucket does not exist.

public Bucket bucket (String name)

Returns a cloud storage Bucket instance for the specified bucket name.

Parameters
name a non-null, non-empty bucket name.
Returns
  • a cloud storage Bucket instance.
Throws
IllegalArgumentException If the bucket name is null, empty, or if the specified bucket does not exist.

public static synchronized StorageClient getInstance (FirebaseApp app)

public static StorageClient getInstance ()