Documentation for SetBlobPropertiesOptions setters is incorrect #76

Closed
jcookems opened this Issue May 17, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@jcookems
Contributor

jcookems commented May 17, 2012

For example, in the docs for setContentType:

/**
 * Sets the optional MIME content type for the blob content. 
 * This value will be returned to clients in the
 * <code>Content-Type</code> header of the response when
 * the blob data or blob properties are requested. If no
 * content type is specified, the default content type is 
 * <strong>application/octet-stream</strong>.
 * <p>

This is not strictly correct; the service has a default value, but when you use setBlobProperties, the content type header is removed unless the ContentType property is set to the previous value. See http://msdn.microsoft.com/en-us/library/windowsazure/ee691966, which says:

x-ms-blob-content-type
Optional. Sets the blob’s content type.
If this property is not specified on the request, then the property will be cleared for the blob. Subsequent calls to Get Blob Properties (REST API) will not return this property, unless it is explicitly set on the blob again.

It appears the the recommendation for using setBlobProperties should be to first use getBlobProperties, alter it as you like, then submit. Unset properties will clobber server values.

joostdenijs pushed a commit to joostdenijs/azure-sdk-for-java that referenced this issue Jan 18, 2013

@jcookems jcookems closed this in a201fa3 Jan 19, 2013

jianghaolu pushed a commit to jianghaolu/azure-sdk-for-java that referenced this issue Apr 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment