Summary: Methods | Inherited Methods | [Expand All]
public class

# FirebaseStorage

extends Object

java.lang.Object
↳ | com.google.firebase.storage.FirebaseStorage

## Class Overview

FirebaseStorage is a service that supports uploading and downloading large objects to Google Cloud Storage. Pass a custom instance of `FirebaseApp` to `getInstance(FirebaseApp)` which will initialize it with a storage location (bucket) specified via `setStorageBucket(String)`.

Otherwise, if you call `getReference()` without a FirebaseApp, the FirebaseStorage instance will initialize with the default `FirebaseApp` obtainable from `getInstance()`. The storage location in this case will come the JSON configuration file downloaded from the web.

## Summary

Public Methods
FirebaseApp | getApp() The `FirebaseApp` associated with this `FirebaseStorage` instance.
static FirebaseStorage | getInstance() Returns the `FirebaseStorage`, initialized with the default `FirebaseApp`.
static FirebaseStorage | getInstance(FirebaseApp app) Returns the `FirebaseStorage`, initialized with a custom `FirebaseApp`
long | getMaxDownloadRetryTimeMillis() Returns the maximum time to retry a download if a failure occurs.
long | getMaxOperationRetryTimeMillis() Returns the maximum time to retry operations other than upload and download if a failure occurs.
long | getMaxUploadRetryTimeMillis() Returns the maximum time to retry an upload if a failure occurs.
StorageReference | getReference() Creates a new `StorageReference` initialized at the root Firebase Storage location.
StorageReference | getReference(String location) Creates a new `StorageReference` initialized with a child Firebase Storage location.
StorageReference | getReferenceFromUrl(String fullUrl) Creates a `StorageReference` given a gs:// or https:// URL pointing to a Firebase Storage location.
void | setMaxDownloadRetryTimeMillis(long maxTransferRetryMillis) Sets the maximum time to retry a download if a failure occurs.
void | setMaxOperationRetryTimeMillis(long maxTransferRetryMillis) Sets the maximum time to retry operations other than upload and download if a failure occurs.
void | setMaxUploadRetryTimeMillis(long maxTransferRetryMillis) Sets the maximum time to retry an upload if a failure occurs.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Methods

#### public FirebaseApp getApp ()

The `FirebaseApp` associated with this `FirebaseStorage` instance.

#### public static FirebaseStorage getInstance ()

Returns the `FirebaseStorage`, initialized with the default `FirebaseApp`.

##### Returns

- a `FirebaseStorage` instance.

#### public static FirebaseStorage getInstance (FirebaseApp app)

Returns the `FirebaseStorage`, initialized with a custom `FirebaseApp`

##### Parameters

app | The custom `FirebaseApp` used for initialization.

##### Returns

- a `FirebaseStorage` instance.

#### public long getMaxDownloadRetryTimeMillis ()

Returns the maximum time to retry a download if a failure occurs.

##### Returns

- maximum time in milliseconds. Defaults to 10 minutes (600,000 milliseconds).

#### public long getMaxOperationRetryTimeMillis ()

Returns the maximum time to retry operations other than upload and download if a failure occurs.

##### Returns

- the maximum time in milliseconds. Defaults to 2 minutes (120,000 milliseconds).

#### public long getMaxUploadRetryTimeMillis ()

Returns the maximum time to retry an upload if a failure occurs.

##### Returns

- the maximum time in milliseconds. Defaults to 10 minutes (600,000 milliseconds).

#### public StorageReference getReference ()

Creates a new `StorageReference` initialized at the root Firebase Storage location.

##### Returns

- An instance of `StorageReference`.

#### public StorageReference getReference (String location)

Creates a new `StorageReference` initialized with a child Firebase Storage location.

##### Parameters

location | A relative path from the root to initialize the reference with, for instance "path/to/object"

##### Returns

- An instance of `StorageReference` at the given child path.

#### public StorageReference getReferenceFromUrl (String fullUrl)

Creates a `StorageReference` given a gs:// or https:// URL pointing to a Firebase Storage location.

##### Parameters

fullUrl | A gs:// or http[s]:// URL used to initialize the reference. For example, you can pass in a download URL retrieved from `getDownloadUrl()` or the uri retrieved from `toString()` An error is thrown if fullUrl is not associated with the `FirebaseApp` used to initialize this `FirebaseStorage`.

#### public void setMaxDownloadRetryTimeMillis (long maxTransferRetryMillis)

Sets the maximum time to retry a download if a failure occurs.

##### Parameters

maxTransferRetryMillis | the maximum time in milliseconds. Defaults to 10 minutes (600,000 milliseconds).

#### public void setMaxOperationRetryTimeMillis (long maxTransferRetryMillis)

Sets the maximum time to retry operations other than upload and download if a failure occurs.

##### Parameters

maxTransferRetryMillis | the maximum time in milliseconds. Defaults to 2 minutes (120,000 milliseconds).

#### public void setMaxUploadRetryTimeMillis (long maxTransferRetryMillis)

Sets the maximum time to retry an upload if a failure occurs.

##### Parameters

maxTransferRetryMillis | the maximum time in milliseconds. Defaults to 10 minutes (600,000 milliseconds).