From e364c2e07bc2e55852c55e66c027bc509e69d2d8 Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 2 Sep 2013 12:56:10 +0200 Subject: [PATCH 1/4] #863: clearBlobPages 'text' parameter is unused. --- lib/services/blob/blobservice.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/services/blob/blobservice.js b/lib/services/blob/blobservice.js index 2233c834b..8f2cfe3fd 100644 --- a/lib/services/blob/blobservice.js +++ b/lib/services/blob/blobservice.js @@ -1856,7 +1856,6 @@ BlobService.prototype.breakLease = function (container, blob, leaseId, optionsOr * @this {BlobService} * @param {string} container The container name. * @param {string} blob The blob name. -* @param {string} text The text string. * @param {int} rangeStart The range start. * @param {int} rangeEnd The range end. * @param {object} [options] The page blob and request options. From 373c25dc893eb40ac30648318e1b445ae9a24420 Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 2 Sep 2013 12:57:45 +0200 Subject: [PATCH 2/4] #874: BlobService.copyBlob doc comments are wrong --- lib/services/blob/blobservice.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/services/blob/blobservice.js b/lib/services/blob/blobservice.js index 8f2cfe3fd..66d433f53 100644 --- a/lib/services/blob/blobservice.js +++ b/lib/services/blob/blobservice.js @@ -1636,8 +1636,7 @@ BlobService.prototype.createBlobSnapshot = function (container, blob, optionsOrC * Copies a blob to a destination within the storage account. The Copy Blob operation copies the entire committed blob. * * @this {BlobService} -* @param {string} sourceContainer The source container name. -* @param {string} sourceBlob The source blob name. +* @param {string} sourceUri The source blob URI. * @param {string} targetContainer The target container name. * @param {string} targetBlob The target blob name. * @param {object} [options] The blobs and request options. From 1ae6a294c0fb785c32bd47f385781c87fc4e38d5 Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 2 Sep 2013 12:59:54 +0200 Subject: [PATCH 3/4] #861: acquireLease has two parameters for specifying LeaseDuration: leaseDuration and optionsOrCallback.leaseDuration. Only optionsOrCallback.leaseDuration is actually used. --- lib/services/blob/blobservice.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/services/blob/blobservice.js b/lib/services/blob/blobservice.js index 66d433f53..3ac21e27e 100644 --- a/lib/services/blob/blobservice.js +++ b/lib/services/blob/blobservice.js @@ -1759,7 +1759,6 @@ BlobService.prototype.abortCopyBlob = function (container, blob, copyId, options * @this {BlobService} * @param {string} container The container name. * @param {string} blob The blob name. -* @param {int} leaseDuration The lease duration. * @param {object} [options] The blob and request options. * @param {string} [options.leaseDuration] The lease duration. Default is never to expire. * @param {string} [options.proposedLeaseId] The proposed lease identifier. From c2aa558efa13f3709a2e4f6b99c8cee248a65493 Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 2 Sep 2013 13:15:41 +0200 Subject: [PATCH 4/4] Add parameter validation to give appropriate named errors --- lib/services/blob/blobservice.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/services/blob/blobservice.js b/lib/services/blob/blobservice.js index 3ac21e27e..9d832fbbd 100644 --- a/lib/services/blob/blobservice.js +++ b/lib/services/blob/blobservice.js @@ -921,7 +921,7 @@ BlobService.prototype.putBlockBlobFromFile = function (container, blob, localFil * @example * var azure = require('azure'); * var blobService = azure.createBlobService(); -* blobService.createBlockBlobFromStream('taskcontainer', 'task1', fs.createReadStream('task1-upload.txt'), 11, function(error) { +* blobService.putBlockBlobFromStream('taskcontainer', 'task1', fs.createReadStream('task1-upload.txt'), 11, function(error) { * if(!error) { * // Blob uploaded * } @@ -2624,6 +2624,14 @@ BlobService.prototype.createBlockBlobFromFile = function (container, blob, local * @return {SpeedSummary} */ BlobService.prototype.createBlockBlobFromStream = function (container, blob, stream, streamLength, optionsOrCallback, callback) { + validate.validateArgs('createBlockBlobFromStream', function (v) { + v.string(container, 'container'); + v.string(blob, 'blob'); + v.containerNameIsValid(container); + v.blobNameIsValid(container, blob); + v.callback(callback); + }); + if (streamLength >= this.singleBlobPutThresholdInBytes) { return this._createBlobFromStream(container, blob, BlobConstants.BlobTypes.BLOCK, stream, streamLength, optionsOrCallback, callback); } else {