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

Public Constructors

public StorageMetadata ()

Creates a StorageMetadata object to hold metadata for a StorageReference

Public Methods

public String getBucket ()

Returns
String the owning Google Cloud Storage bucket for the StorageReference

public String getCacheControl ()

Returns
String the Cache Control setting of the StorageReference

public String getContentDisposition ()

Returns
String the content disposition of the StorageReference

public String getContentEncoding ()

Returns
String the content encoding for the StorageReference

public String getContentLanguage ()

Returns
String the content language for the StorageReference

public String getContentType ()

Returns
String the content type of the StorageReference.

public long getCreationTimeMillis ()

Returns
long the time the StorageReference was created.

public String getCustomMetadata (String key)

Returns custom metadata for a StorageReference

Parameters
key String: The key for which the metadata should be returned
Returns
String the metadata stored in the object the given key.

public Set<String> getCustomMetadataKeys ()

Returns
Set<String> 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
Uri 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
List<Uri> all unguessable Urls that can be used to download the StorageReference

public String getGeneration ()

Returns
String a version String indicating what version of the StorageReference

public String getMd5Hash ()

Returns
String the MD5Hash of the StorageReference object

public String getMetadataGeneration ()

Returns
String a version String indicating the version of this StorageMetadata

public String getName ()

Returns
String a simple name of the StorageReference object

public String getPath ()

Returns
String the path of the StorageReference object

public StorageReference getReference ()

Returns
StorageReference the associated StorageReference for which this metadata belongs to.

public long getSizeBytes ()

Returns
long the stored Size in bytes of the StorageReference object

public long getUpdatedTimeMillis ()

Returns
long the time the StorageReference was last updated.