FIRStorageMetadata


@interface FIRStorageMetadata : NSObject <NSCopying>

Class which represents the metadata on an object in Firebase Storage. This metadata is returned on successful operations, and can be used to retrieve download URLs, content types, and a FIRStorage reference to the object in question. Full documentation can be found at the GCS Objects#resource docs.

  • The name of the bucket containing this object.

    Declaration

    Swift

    var bucket: String { get }

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull bucket;
  • Cache-Control directive for the object data.

    Declaration

    Swift

    var cacheControl: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *cacheControl;
  • Content-Disposition of the object data.

    Declaration

    Swift

    var contentDisposition: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *contentDisposition;
  • Content-Encoding of the object data.

    Declaration

    Swift

    var contentEncoding: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *contentEncoding;
  • Content-Language of the object data.

    Declaration

    Swift

    var contentLanguage: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *contentLanguage;
  • Content-Type of the object data.

    Declaration

    Swift

    var contentType: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *contentType;
  • The content generation of this object. Used for object versioning.

    Declaration

    Swift

    var generation: Int64 { get }

    Objective-C

    @property (readonly, atomic) int64_t generation;
  • User-provided metadata, in key/value pairs.

    Declaration

    Swift

    var customMetadata: [String : String]? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        NSDictionary<NSString *, NSString *> *customMetadata;
  • The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.

    Declaration

    Swift

    var metageneration: Int64 { get }

    Objective-C

    @property (readonly, atomic) int64_t metageneration;
  • The name of this object, in gs://bucket/path/to/object.txt, this is object.txt.

    Declaration

    Swift

    var name: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *name;
  • The full path of this object, in gs://bucket/path/to/object.txt, this is path/to/object.txt.

    Declaration

    Swift

    var path: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *path;
  • Content-Length of the data in bytes.

    Declaration

    Swift

    var size: Int64 { get }

    Objective-C

    @property (readonly, atomic) int64_t size;
  • The creation time of the object in RFC 3339 format.

    Declaration

    Swift

    var timeCreated: Date? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSDate *timeCreated;
  • The modification time of the object metadata in RFC 3339 format.

    Declaration

    Swift

    var updated: Date? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSDate *updated;
  • A reference to the object in Firebase Storage.

    Declaration

    Swift

    var storageReference: FIRStorageReference? { get }

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        FIRStorageReference *storageReference;
  • An array containing all download URLs available for the object.

    Declaration

    Swift

    var downloadURLs: [URL]? { get }

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSArray<NSURL *> *downloadURLs;
  • Creates an instanece of FIRStorageMetadata from the contents of a dictionary.

    Declaration

    Swift

    init?(dictionary: [String : Any])

    Objective-C

    - (nullable instancetype)initWithDictionary:
        (nonnull NSDictionary<NSString *, id> *)dictionary;

    Return Value

    An instance of FIRStorageMetadata that represents the contents of a dictionary.

  • Creates an NSDictionary from the contents of the metadata.

    Declaration

    Swift

    func dictionaryRepresentation() -> [String : Any]

    Objective-C

    - (nonnull NSDictionary<NSString *, id> *)dictionaryRepresentation;

    Return Value

    An NSDictionary that represents the contents of the metadata.

  • Determines if the current metadata represents a file.

    Declaration

    Swift

    var isFile: Bool { get }

    Objective-C

    @property (readonly, getter=isFile, atomic) BOOL file;
  • Determines if the current metadata represents a folder.

    Declaration

    Swift

    var isFolder: Bool { get }

    Objective-C

    @property (readonly, getter=isFolder, atomic) BOOL folder;
  • Retrieves a download URL for the given object, or nil if none exist. Note that if there are many valid download tokens, this will always return the first valid token created.

    Declaration

    Swift

    func downloadURL() -> URL?

    Objective-C

    - (nullable NSURL *)downloadURL;