StorageMetadata

classStorageMetadata


Metadata for aStorageReference. 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 aStorageMetadata object to hold metadata for aStorageReference

Public constructors

StorageMetadata

StorageMetadata()

Creates aStorageMetadata object to hold metadata for aStorageReference

Public functions

getBucket

fun getBucket(): String?
Returns
String?

the owning Google Cloud Storage bucket for theStorageReference

getCacheControl

fun getCacheControl(): String?
Returns
String?

the Cache Control setting of theStorageReference

getContentDisposition

fun getContentDisposition(): String?
Returns
String?

the content disposition of theStorageReference

getContentEncoding

fun getContentEncoding(): String?
Returns
String?

the content encoding for theStorageReference

getContentLanguage

fun getContentLanguage(): String?
Returns
String?

the content language for theStorageReference

getContentType

fun getContentType(): String?
Returns
String?

the content type of theStorageReference.

getCreationTimeMillis

fun getCreationTimeMillis(): Long
Returns
Long

the time theStorageReference was created.

getCustomMetadata

fun getCustomMetadata(key: String): String?

Returns custom metadata for aStorageReference

Parameters
key: String

The key for which the metadata should be returned

Returns
String?

the metadata stored in the object the given key.

getCustomMetadataKeys

fun getCustomMetadataKeys(): (Mutable)Set<String!>
Returns
(Mutable)Set<String!>

the keys for custom metadata.

getGeneration

fun getGeneration(): String?
Returns
String?

a version String indicating what version of theStorageReference

getMd5Hash

fun getMd5Hash(): String?
Returns
String?

the MD5Hash of theStorageReference object

getMetadataGeneration

fun getMetadataGeneration(): String?
Returns
String?

a version String indicating the version of thisStorageMetadata

getName

fun getName(): String?
Returns
String?

a simple name of theStorageReference object

getPath

fun getPath(): String
Returns
String

the path of theStorageReference object

getReference

fun getReference(): StorageReference?
Returns
StorageReference?

the associatedStorageReference for which this metadata belongs to.

getSizeBytes

fun getSizeBytes(): Long
Returns
Long

the stored Size in bytes of theStorageReference object

getUpdatedTimeMillis

fun getUpdatedTimeMillis(): Long
Returns
Long

the time theStorageReference was last updated.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.