Merge pull request #105 from pofallon/dev

Changes to committing a list of blob blocks
This commit is contained in:
André Rodrigues 2012-02-27 19:07:59 -08:00
Родитель 7491997b21 76c1f76eae
Коммит 1314730681
3 изменённых файлов: 17 добавлений и 6 удалений

Просмотреть файл

@ -2043,10 +2043,20 @@ BlobService.prototype.createBlobBlockFromStream = function (blockId, container,
* @this {BlobService}
* @param {string} container The container name.
* @param {string} blob The blob name.
* @param {array} blockList The block identifiers.
* @param {object} blockList The block identifiers.
* @param {object|function} [optionsOrCallback] The blocklist and request options.
* @param {object} [optionsOrCallback.metadata] The metadata key/value pairs.
* @param {string} [optionsOrCallback.leaseId] The target blob lease identifier.
* @param {string} [optionsOrCallback.contentType] The MIME content type of the blob. The default type is application/octet-stream.
* @param {string} [optionsOrCallback.contentEncoding] The content encodings that have been applied to the blob.
* @param {string} [optionsOrCallback.contentLanguage] The natural languages used by this resource.
* @param {string} [optionsOrCallback.contentMD5] The MD5 hash of the blob content.
* @param {string} [optionsOrCallback.cacheControl] The Blob service stores this value but does not use or modify it.
* @param {string} [optionsOrCallback.contentTypeHeader] The blobs content type. (x-ms-blob-content-type)
* @param {string} [optionsOrCallback.contentEncodingHeader] The blobs content encoding. (x-ms-blob-content-encoding)
* @param {string} [optionsOrCallback.contentLanguageHeader] The blob's content language. (x-ms-blob-content-language)
* @param {string} [optionsOrCallback.contentMD5Header] The blobs MD5 hash. (x-ms-blob-content-md5)
* @param {string} [optionsOrCallback.cacheControlHeader] The blob's cache control. (x-ms-blob-cache-control)
* @param {object} [optionsOrCallback.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
* @param {int} [optionsOrCallback.timeoutIntervalInMs] The timeout interval, in milliseconds, to use for the request.
* @param {function(error, blocklist, response)} callback The callback function.

Просмотреть файл

@ -56,7 +56,7 @@ BlockListResult.serialize = function (blockListJs) {
if (blockListJs.CommittedBlocks) {
blockListJs.CommittedBlocks.forEach(function (block) {
blockListDoc = blockListDoc.ele(Constants.COMMITTED_BLOCKS_ELEMENT)
blockListDoc = blockListDoc.ele(Constants.COMMITTED_ELEMENT)
.txt(new Buffer(block).toString('base64'))
.up();
});
@ -64,7 +64,7 @@ BlockListResult.serialize = function (blockListJs) {
if (blockListJs.UncommittedBlocks) {
blockListJs.UncommittedBlocks.forEach(function (block) {
blockListDoc = blockListDoc.ele(Constants.UNCOMMITTED_BLOCKS_ELEMENT)
blockListDoc = blockListDoc.ele(Constants.UNCOMMITTED_ELEMENT)
.txt(new Buffer(block).toString('base64'))
.up();
});

Просмотреть файл

@ -1110,7 +1110,8 @@ suite('blobservice-tests', function () {
assert.equal(error3, null);
var blockList = {
LatestBlocks: ['id1', 'id2']
LatestBlocks: ['id1'],
UncommittedBlocks: ['id2']
};
blobService.commitBlobBlocks(containerName, blobName, blockList, function (error4) {
@ -1125,7 +1126,7 @@ suite('blobservice-tests', function () {
done();
});
});
});
});
});
});
});
@ -1160,4 +1161,4 @@ function repeat(s, n) {
ret += s;
}
return ret;
};
};