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

Commit fd2bf93

Browse files
committed
Last minute cleanup before release
1 parent 92cd335 commit fd2bf93

File tree

8 files changed

+18
-7
lines changed

8 files changed

+18
-7
lines changed

BreakingChanges.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
XXXX.XX.XX Version X.X.X
1+
2018.08.22 Version 10.0.4-rc
22
* Changed BlobURL.startCopy sourceAccessConditions parameter to be HTTPAccessConditions as lease is not actually supported.
33
* UploadFromFile now takes an AsynchronousFileChannel.
44
* UploadByteBuffersToBlockBlob, UploadByteBufferToBlockBlob, and DownloadToBuffer have been removed.

ChangeLog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
XXXX.XX.XX Version XX.X.X
1+
2018.08.22 Version 10.0.4-rc
22
* Support for the 2017-11-09 REST version. Please see our REST api documentation and blogs for information about the related added features.
33
* Support for 2018-03-28 REST version. Please see our REST api documentation and blogs for information about the related added features.
44
* Support for the getAccountInfo api on ServiceURL, ContainerURL, and BlobURL.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>
3333
<artifactId>azure-storage-blob</artifactId>
34-
<version>10.0.3-Preview</version>
34+
<version>10.0.4-rc</version>
3535
</dependency>
3636
```
3737

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<groupId>com.microsoft.azure</groupId>
1616
<artifactId>azure-storage-blob</artifactId>
17-
<version>10.0.3-Preview</version>
17+
<version>10.0.4-rc</version>
1818

1919
<name>Azure Storage Blob</name>
2020
<description>The Azure Storage Java Blob library.</description>

src/main/java/com/microsoft/azure/storage/blob/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static final class HeaderConstants {
121121
/**
122122
* Specifies the value to use for UserAgent header.
123123
*/
124-
static final String USER_AGENT_VERSION = "10.0.3-Preview";
124+
static final String USER_AGENT_VERSION = "10.0.4-rc";
125125

126126
private HeaderConstants() {
127127
// Private to prevent construction.

src/main/java/com/microsoft/azure/storage/blob/TransferManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ public static Single<BlobDownloadHeaders> downloadBlobToFile(AsynchronousFileCha
188188

189189
int numChunks = calculateNumBlocks(dataSize, o.chunkSize);
190190

191+
// In case it is an empty blob, this ensures we still actually perform a download operation.
192+
numChunks = numChunks == 0 ? 1 : numChunks;
193+
191194
return Observable.range(0, numChunks)
192195
.flatMap(i -> {
193196
// Calculate whether we need a full chunk or something smaller because we are at the end.

src/test/java/com/microsoft/azure/storage/Samples.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,9 @@ For the blob, show each block (ID and size) that is a committed part of it. It i
10871087
to include blocks that have been staged but not committed.
10881088
*/
10891089
blobURL.getBlockList(BlockListType.ALL, null))
1090+
.flatMap(response ->
1091+
// Delete the container
1092+
containerURL.delete(null))
10901093
/*
10911094
This will synchronize all the above operations. This is strongly discouraged for use in production as
10921095
it eliminates the benefits of asynchronous IO. We use it here to enable the sample to complete and
@@ -1469,6 +1472,7 @@ Passing RetryReaderOptions to a call to body() will ensure the download stream i
14691472
.lastOrError() // Place holder for processing all the intermediary data.
14701473
// After the last piece of data, clean up by deleting the container and all its contents.
14711474
.flatMap(buffer ->
1475+
// Delete the container
14721476
containerURL.delete(null))
14731477
/*
14741478
This will synchronize all the above operations. This is strongly discouraged for use in production as

src/test/java/com/microsoft/azure/storage/TransferManagerTest.groovy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,17 @@ class TransferManagerTest extends APISpec {
297297
def testPipeline = HttpPipeline.build(new RequestRetryFactory(new RequestRetryOptions(null, 3, null, null, null,
298298
null)), mockFactory)
299299
bu = bu.withPipeline(testPipeline)
300+
def channel = AsynchronousFileChannel.open(file.toPath())
300301

301302
when:
302-
TransferManager.uploadFileToBlockBlob(AsynchronousFileChannel.open(file.toPath()), bu, 50, null).blockingGet()
303+
TransferManager.uploadFileToBlockBlob(channel, bu, 50, null).blockingGet()
303304

304305
then:
305306
def e = thrown(StorageException)
306307
e.statusCode() == 500
308+
309+
cleanup:
310+
channel.close()
307311
}
308312

309313
def "Upload options fail"() {
@@ -340,8 +344,8 @@ class TransferManagerTest extends APISpec {
340344
getRandomFile(20) | _ // small file
341345
getRandomFile(16 * 1024 * 1024) | _ // medium file in several chunks
342346
getRandomFile(8L * 1026 * 1024 + 10) | _ // medium file not aligned to block
343-
getRandomFile(5L * 1024 * 1024 * 1024) | _ // file size exceeds max int
344347
getRandomFile(0) | _ // empty file
348+
getRandomFile(5L * 1024 * 1024 * 1024) | _ // file size exceeds max int
345349
}
346350

347351
def compareFiles(AsynchronousFileChannel channel1, long offset, long count, AsynchronousFileChannel channel2) {

0 commit comments

Comments
 (0)