Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
Fixed a broken sample and misc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rickle-msft committed Mar 21, 2019
1 parent 14036fa commit b3e44bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ public Single<AppendBlobAppendBlockFromUrlResponse> appendBlockFromUrl(URL sourc
byte[] sourceContentMD5, AppendBlobAccessConditions destAccessConditions,
SourceModifiedAccessConditions sourceAccessConditions, Context context) {

sourceRange = sourceRange == null ? BlobRange.DEFAULT : sourceRange;
sourceRange = sourceRange == null ? new BlobRange() : sourceRange;
destAccessConditions = destAccessConditions == null
? new AppendBlobAccessConditions() : destAccessConditions;
context = context == null ? Context.NONE : context;

return addErrorWrappingToSingle(
return postProcessResponse(
this.storageClient.generatedAppendBlobs().appendBlockFromUrlWithRestResponseAsync(context,
sourceURL, 0, sourceRange.toString(), sourceContentMD5, null, null,
destAccessConditions.leaseAccessConditions(),
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/com/microsoft/azure/storage/Samples.java
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public void exampleAccountSASSignatureValues() throws InvalidKeyException, Malfo
// Calling encode will generate the query string.
String encodedParams = params.encode();

String urlToSendToSomeone = String.format(Locale.ROOT, "https://%s.blob.core.windows.net?%s",
String urlToSendToSomeone = String.format(Locale.ROOT, "https://%s.blob.core.windows.net%s",
accountName, encodedParams);
// At this point, you can send the urlToSendSomeone to someone via email or any other mechanism you choose.

Expand Down Expand Up @@ -1413,7 +1413,7 @@ public void exampleFileTransfer() throws IOException, InvalidKeyException {
.flatMap(response -> Single.using(
() -> AsynchronousFileChannel.open(tempFile.toPath(), StandardOpenOption.READ),
channel -> TransferManager.uploadFileToBlockBlob(channel, blobURL,
BlockBlobURL.MAX_STAGE_BLOCK_BYTES, null),
BlockBlobURL.MAX_STAGE_BLOCK_BYTES, null, null),
AsynchronousFileChannel::close)
)
.flatMap(response -> Single.using(
Expand Down Expand Up @@ -1506,7 +1506,8 @@ Passing ReliableDownloadOptions to a call to body() will ensure the download str
// Upload some data to a blob
Single.using(() -> AsynchronousFileChannel.open(file.toPath()),
fileChannel -> TransferManager.uploadFileToBlockBlob(fileChannel, blobURL,
BlockBlobURL.MAX_STAGE_BLOCK_BYTES, new TransferManagerUploadToBlockBlobOptions()),
BlockBlobURL.MAX_STAGE_BLOCK_BYTES, null,
new TransferManagerUploadToBlockBlobOptions()),
AsynchronousFileChannel::close))
.flatMap(response ->
blobURL.download(null, null, false, null))
Expand Down Expand Up @@ -2217,7 +2218,7 @@ Create the blob with string (plain text) content.
.flatMap(response -> Single.using(
() -> AsynchronousFileChannel.open(tempFile.toPath(), StandardOpenOption.READ),
channel -> TransferManager.uploadFileToBlockBlob(channel, blobURL,
BlockBlobURL.MAX_STAGE_BLOCK_BYTES, null),
BlockBlobURL.MAX_STAGE_BLOCK_BYTES, null, null),
AsynchronousFileChannel::close)
)
.flatMap(response -> Single.using(
Expand Down

0 comments on commit b3e44bd

Please sign in to comment.