StorageMetadata

public class StorageMetadata extends Object

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.

Nested Class Summary

class StorageMetadata.Builder Creates a StorageMetadata object. 

Public Constructor Summary

StorageMetadata()
Creates a StorageMetadata object to hold metadata for a StorageReference

Public Method Summary

String
String
String
String
String
String
long
String
getCustomMetadata(String key)
Returns custom metadata for a StorageReference
Set<String>
Uri
getDownloadUrl()
Returns a long lived download URL with a revokable token.
List<Uri>
String
String
String
String
String
StorageReference
long
long

Inherited Method Summary

Public Constructors

public StorageMetadata ()

Creates a StorageMetadata object to hold metadata for a StorageReference

Public Methods

public String getBucket ()

Returns

public String getCacheControl ()

Returns

public String getContentDisposition ()

Returns

public String getContentEncoding ()

Returns

public String getContentLanguage ()

Returns

public String getContentType ()

Returns

public long getCreationTimeMillis ()

Returns

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

public String getGeneration ()

Returns

public String getMd5Hash ()

Returns

public String getMetadataGeneration ()

Returns

public String getName ()

Returns

public String getPath ()

Returns

public StorageReference getReference ()

Returns

public long getSizeBytes ()

Returns

public long getUpdatedTimeMillis ()

Returns