StorageMetadata

public class StorageMetadata


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 types

Creates a StorageMetadata object.

Public constructors

Creates a StorageMetadata object to hold metadata for a StorageReference

Public constructors

StorageMetadata

public StorageMetadata()

Creates a StorageMetadata object to hold metadata for a StorageReference

Public methods

getBucket

public @Nullable String getBucket()
Returns
@Nullable String

the owning Google Cloud Storage bucket for the StorageReference

getCacheControl

public @Nullable String getCacheControl()
Returns
@Nullable String

the Cache Control setting of the StorageReference

getContentDisposition

public @Nullable String getContentDisposition()
Returns
@Nullable String

the content disposition of the StorageReference

getContentEncoding

public @Nullable String getContentEncoding()
Returns
@Nullable String

the content encoding for the StorageReference

getContentLanguage

public @Nullable String getContentLanguage()
Returns
@Nullable String

the content language for the StorageReference

getContentType

public @Nullable String getContentType()
Returns
@Nullable String

the content type of the StorageReference.

getCreationTimeMillis

public long getCreationTimeMillis()
Returns
long

the time the StorageReference was created.

getCustomMetadata

public @Nullable String getCustomMetadata(@NonNull String key)

Returns custom metadata for a StorageReference

Parameters
@NonNull String key

The key for which the metadata should be returned

Returns
@Nullable String

the metadata stored in the object the given key.

getCustomMetadataKeys

public @NonNull Set<StringgetCustomMetadataKeys()
Returns
@NonNull Set<String>

the keys for custom metadata.

getGeneration

public @Nullable String getGeneration()
Returns
@Nullable String

a version String indicating what version of the StorageReference

getMd5Hash

public @Nullable String getMd5Hash()
Returns
@Nullable String

the MD5Hash of the StorageReference object

getMetadataGeneration

public @Nullable String getMetadataGeneration()
Returns
@Nullable String

a version String indicating the version of this StorageMetadata

getName

public @Nullable String getName()
Returns
@Nullable String

a simple name of the StorageReference object

getPath

public @NonNull String getPath()
Returns
@NonNull String

the path of the StorageReference object

getReference

public @Nullable StorageReference getReference()
Returns
@Nullable StorageReference

the associated StorageReference for which this metadata belongs to.

getSizeBytes

public long getSizeBytes()
Returns
long

the stored Size in bytes of the StorageReference object

getUpdatedTimeMillis

public long getUpdatedTimeMillis()
Returns
long

the time the StorageReference was last updated.