Skip to content

BlobContract.create*Blob|copyBlob should return etag of created object #74

Description

@jcookems

When a blob is created, the service returns a message like this (with some parts elided)

HTTP/1.1 201 Created
Last-Modified: Thu, 17 May 2012 17:54:50 GMT
ETag: "0x8CF026D4A29F829"

The ETag is especially important, because that allows you to ensure that the blob is in the state you think it should be in. For example, if after creating the blob, you want to set some metadata, and you want to be sure that the blob has not been altered by anyone else in the meantime, you would use code like this:

service.setBlobMetadata(container, blob, metadata,
    new SetBlobMetadataOptions()
        .setAccessCondition(AccessCondition.ifMatch(etag));

However, the createBlockBlob is a void method; it returns nothing. So you cannot pass the ETag, and you lose confidence that you are the only one touching the blob. (Reading the blob to get the ETag won't help, because you will have the same latency as just setting the metadata blindly.)

Same issue affects the createBlockBlob and copyBlob methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions