Summary: Nested Classes | Ctors | Methods | Inherited Methods | [Expand All]
public class

# StorageMetadata

extends Object

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

## Class Overview

Metadata for a `StorageReference`. Metadata stores default attributes such as size and content type. You may also store custom metadata key value pairs. Metadata values may be used to authorize operations using declarative validation rules.

## Summary

Nested Classes
class | StorageMetadata.Builder | Creates a StorageMetadata object.

Public Constructors
| StorageMetadata() Creates a `StorageMetadata` object to hold metadata for a `StorageReference`

Public Methods
String | getBucket()
String | getCacheControl()
String | getContentDisposition()
String | getContentEncoding()
String | getContentLanguage()
String | getContentType()
long | getCreationTimeMillis()
String | getCustomMetadata(String key) Returns custom metadata for a `StorageReference`
Set<String> | getCustomMetadataKeys()
Uri | getDownloadUrl() Returns a long lived download URL with a revokable token.
List<Uri> | getDownloadUrls()
String | getGeneration()
String | getMd5Hash()
String | getMetadataGeneration()
String | getName()
String | getPath()
StorageReference | getReference()
long | getSizeBytes()
long | getUpdatedTimeMillis()

[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 Constructors

#### public StorageMetadata ()

Creates a `StorageMetadata` object to hold metadata for a `StorageReference`

## Public Methods

#### public String getBucket ()

##### Returns

- the owning Google Cloud Storage bucket for the `StorageReference`

#### public String getCacheControl ()

##### Returns

- the Cache Control setting of the `StorageReference`

#### public String getContentDisposition ()

##### Returns

- the content disposition of the `StorageReference`

#### public String getContentEncoding ()

##### Returns

- the content encoding for the `StorageReference`

#### public String getContentLanguage ()

##### Returns

- the content language for the `StorageReference`

#### public String getContentType ()

##### Returns

- the content type of the `StorageReference`.

#### public long getCreationTimeMillis ()

##### Returns

- the time the `StorageReference` was created.

#### public String getCustomMetadata (String key)

Returns custom metadata for a `StorageReference`

##### Parameters

key | The key for which the metadata should be returned

##### Returns

- the metadata stored in the object the given key.

#### public Set<String> getCustomMetadataKeys ()

##### Returns

- the keys for custom metadata.

#### public Uri getDownloadUrl ()

Returns a long lived download URL with a revokable token. This can be used to share the file with others, but can be revoked by a developer in the Firebase Console if desired.

##### Returns

- The `Uri` representing the download URL. You can feed this URL into a `URL` and download the object via `openStream()`.

#### public List<Uri> getDownloadUrls ()

##### Returns

- all unguessable Urls that can be used to download the `StorageReference`

#### public String getGeneration ()

##### Returns

- a version String indicating what version of the `StorageReference`

#### public String getMd5Hash ()

##### Returns

- the MD5Hash of the `StorageReference` object

#### public String getMetadataGeneration ()

##### Returns

- a version String indicating the version of this `StorageMetadata`

#### public String getName ()

##### Returns

- a simple name of the `StorageReference` object

#### public String getPath ()

##### Returns

- the path of the `StorageReference` object

#### public StorageReference getReference ()

##### Returns

- the associated `StorageReference` for which this metadata belongs to.

#### public long getSizeBytes ()

##### Returns

- the stored Size in bytes of the `StorageReference` object

#### public long getUpdatedTimeMillis ()

##### Returns

- the time the `StorageReference` was last updated.