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

Commit 764af02

Browse files
author
jofriedm-msft
authored
Merge pull request #207 from Azure/master
5.5.0 Release
2 parents d5ab7b7 + e7abcb5 commit 764af02

File tree

21 files changed

+493
-97
lines changed

21 files changed

+493
-97
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
If you intend to contribute to the project, please make sure you've followed the instructions provided in the [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
22
## Project Setup
3-
The Azure Storage development team uses Eclipse so instructions will be tailored to that preference. However, any preferred IDE or other toolset should be usable.
3+
The Azure Storage development team uses Intellij. However, any preferred IDE or other toolset should be usable.
44

55
### Install
66
* Java SE 6+
7-
* [Eclipse](https://eclipse.org/downloads/)
8-
* [Maven plugin for Eclipse](http://www.eclipse.org/m2e/index.html). Some Eclipse packages (ex Eclipse IDE for Java Developers) may come with this plugin already installed.
97
* [Maven](https://maven.apache.org/install.html)
108
* Clone the source code from GitHub
119

12-
### Open Solution
13-
Open the project from Eclipse using File->Import->Maven->Existing Maven Projects and navigating to the azure-storage-java folder. Select the listed pom. This imports the source and the test files and downloads the required dependencies via Maven. If you'd like to import the samples, follow the same procedure but navigate to the azure-storage-java\microsoft-azure-storage-samples folder and select that pom. Both projects can be opened at the same time and will be shown in the Package Explorer.
10+
#### IntelliJ Installation
11+
* [IntelliJ](https://www.jetbrains.com/idea/download)
12+
* [Importing project from Maven for IntelliJ](https://www.jetbrains.com/help/idea//2017.1/importing-project-from-maven-model.html)
13+
14+
#### Eclipse Installation
15+
* [Eclipse](https://eclipse.org/downloads/)
16+
* [Maven plugin for Eclipse](http://www.eclipse.org/m2e/index.html). Some Eclipse packages (ex Eclipse IDE for Java Developers) may come with this plugin already installed.
17+
* Open the project from Eclipse using File->Import->Maven->Existing Maven Projects and navigating to the azure-storage-java folder. Select the listed pom. This imports the source and the test files and downloads the required dependencies via Maven. If you'd like to import the samples, follow the same procedure but navigate to the azure-storage-java\microsoft-azure-storage-samples folder and select that pom. Both projects can be opened at the same time and will be shown in the Package Explorer.
1418

1519
## Tests
1620

@@ -38,7 +42,7 @@ The following are the minimum requirements for any pull request that must be met
3842
* Thoroughly test your feature
3943

4044
### Branching Policy
41-
Changes should be based on the **dev** branch, not master as master is considered publicly released code. If after discussion with us breaking changes are considered for the library, we will create a **dev_breaking** branch based on dev which can be used to store these changes until the next breaking release. Each breaking change should be recorded in [BreakingChanges.md](BreakingChanges.md).
45+
Changes should be based on the **dev** branch for non-breaking changes and **dev_breaking** for breaking changes. Do not submit pull requests against master as master is considered publicly released code. Each breaking change should be recorded in [BreakingChanges.md](BreakingChanges.md).
4246

4347
### Adding Features for Java 6+
4448
We strive to release each new feature in a backward compatible manner. Therefore, we ask that all contributions be written to work in Java 6, 7 and 8.

ChangeLog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2017.08.28 Version 5.5.0
2+
* Fixed a bug when using a SAS token where the token was being omitted from calls to delete a directory in the file service.
3+
* For Standard Storage Accounts only, added the ability to set the tier of individual block blobs. The tier can currently only be set through uploadTier()
4+
15
2017.07.13 Version 5.4.0
26
* Support for 2017-04-17 REST version. Please see our REST API documentation and blogs for information about the related added features.
37
* Added ErrorReceivingResponseEvent which fires when a network error occurs before the responseReceivedEvent fires. If the responseReceivedEvent fires sucessfully, this new event will not fire.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w
3030
<dependency>
3131
<groupId>com.microsoft.azure</groupId>
3232
<artifactId>azure-storage</artifactId>
33-
<version>5.4.0</version>
33+
<version>5.5.0</version>
3434
</dependency>
3535
```
3636

microsoft-azure-storage-samples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>com.microsoft.azure</groupId>
2828
<artifactId>azure-storage</artifactId>
29-
<version>5.4.0</version>
29+
<version>5.5.0</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/logging/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>com.microsoft.azure</groupId>
2828
<artifactId>azure-storage</artifactId>
29-
<version>5.4.0</version>
29+
<version>5.5.0</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>

microsoft-azure-storage-test/src/com/microsoft/azure/storage/blob/CloudBlockBlobTests.java

Lines changed: 79 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,7 @@
4848
import java.net.URI;
4949
import java.net.URISyntaxException;
5050
import java.security.InvalidKeyException;
51-
import java.util.ArrayList;
52-
import java.util.Calendar;
53-
import java.util.Date;
54-
import java.util.EnumSet;
55-
import java.util.GregorianCalendar;
56-
import java.util.List;
57-
import java.util.Map;
58-
import java.util.Random;
59-
import java.util.TimeZone;
51+
import java.util.*;
6052

6153
import com.microsoft.azure.storage.StorageErrorCodeStrings;
6254
import com.microsoft.azure.storage.TestRunners.CloudTests;
@@ -1942,4 +1934,82 @@ private void doCloudBlockBlobCopy(boolean sourceIsSas, boolean destinationIsSas)
19421934
destination.delete();
19431935
source.delete();
19441936
}
1937+
1938+
@Test
1939+
@Category({ DevFabricTests.class, DevStoreTests.class })
1940+
public void testCloudBlockBlobUploadStandardTier() throws StorageException, IOException, URISyntaxException {
1941+
for (StandardBlobTier standardBlobTier : StandardBlobTier.values()) {
1942+
if (standardBlobTier == StandardBlobTier.UNKNOWN) {
1943+
continue;
1944+
}
1945+
1946+
final String blobName = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlob");
1947+
final CloudBlockBlob blob = this.container.getBlockBlobReference(blobName);
1948+
blob.uploadText("text");
1949+
1950+
blob.uploadStandardBlobTier(standardBlobTier);
1951+
assertEquals(standardBlobTier, blob.getProperties().getStandardBlobTier());
1952+
assertNull(blob.getProperties().getPremiumPageBlobTier());
1953+
assertNull(blob.getProperties().getRehydrationStatus());
1954+
1955+
CloudBlockBlob blob2 = this.container.getBlockBlobReference(blobName);
1956+
blob2.downloadAttributes();
1957+
assertEquals(standardBlobTier, blob2.getProperties().getStandardBlobTier());
1958+
assertNull(blob2.getProperties().getPremiumPageBlobTier());
1959+
assertNull(blob2.getProperties().getRehydrationStatus());
1960+
1961+
CloudBlockBlob blob3 = (CloudBlockBlob)this.container.listBlobs().iterator().next();
1962+
assertEquals(standardBlobTier, blob3.getProperties().getStandardBlobTier());
1963+
assertNull(blob3.getProperties().getPremiumPageBlobTier());
1964+
assertNull(blob3.getProperties().getRehydrationStatus());
1965+
1966+
blob.deleteIfExists();
1967+
}
1968+
}
1969+
1970+
@Test
1971+
@Category({ DevFabricTests.class, DevStoreTests.class })
1972+
public void testCloudBlockBlobRehydrateBlob() throws StorageException, IOException, URISyntaxException {
1973+
final String blobName1 = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlob1");
1974+
final String blobName2 = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlob2");
1975+
final CloudBlockBlob blob = this.container.getBlockBlobReference(blobName1);
1976+
blob.uploadText("text");
1977+
blob.uploadStandardBlobTier(StandardBlobTier.ARCHIVE);
1978+
final CloudBlockBlob blob2 = this.container.getBlockBlobReference(blobName2);
1979+
blob2.uploadText("text");
1980+
blob2.uploadStandardBlobTier(StandardBlobTier.ARCHIVE);
1981+
1982+
CloudBlockBlob blobRef1 = this.container.getBlockBlobReference(blobName1);
1983+
blobRef1.uploadStandardBlobTier(StandardBlobTier.COOL);
1984+
assertNull(blobRef1.getProperties().getRehydrationStatus());
1985+
assertEquals(StandardBlobTier.ARCHIVE, blobRef1.getProperties().getStandardBlobTier());
1986+
assertNull(blobRef1.getProperties().getPremiumPageBlobTier());
1987+
1988+
blob.downloadAttributes();
1989+
assertEquals(RehydrationStatus.PENDING_TO_COOL, blob.getProperties().getRehydrationStatus());
1990+
assertEquals(StandardBlobTier.ARCHIVE, blob.getProperties().getStandardBlobTier());
1991+
assertNull(blob.getProperties().getPremiumPageBlobTier());
1992+
1993+
CloudBlockBlob blobRef2 = this.container.getBlockBlobReference(blobName2);
1994+
blobRef2.uploadStandardBlobTier(StandardBlobTier.HOT);
1995+
assertNull(blobRef2.getProperties().getRehydrationStatus());
1996+
assertEquals(StandardBlobTier.ARCHIVE, blobRef2.getProperties().getStandardBlobTier());
1997+
assertNull(blobRef2.getProperties().getPremiumPageBlobTier());
1998+
1999+
blob2.downloadAttributes();
2000+
assertEquals(RehydrationStatus.PENDING_TO_HOT, blob2.getProperties().getRehydrationStatus());
2001+
assertEquals(StandardBlobTier.ARCHIVE, blob2.getProperties().getStandardBlobTier());
2002+
assertNull(blob2.getProperties().getPremiumPageBlobTier());
2003+
2004+
Iterator it = this.container.listBlobs().iterator();
2005+
CloudBlockBlob listBlob = (CloudBlockBlob)it.next();
2006+
assertEquals(RehydrationStatus.PENDING_TO_COOL, listBlob.getProperties().getRehydrationStatus());
2007+
assertEquals(StandardBlobTier.ARCHIVE, listBlob.getProperties().getStandardBlobTier());
2008+
assertNull(listBlob.getProperties().getPremiumPageBlobTier());
2009+
2010+
CloudBlockBlob listBlob2 = (CloudBlockBlob)it.next();
2011+
assertEquals(RehydrationStatus.PENDING_TO_HOT, listBlob2.getProperties().getRehydrationStatus());
2012+
assertEquals(StandardBlobTier.ARCHIVE, listBlob2.getProperties().getStandardBlobTier());
2013+
assertNull(listBlob2.getProperties().getPremiumPageBlobTier());
2014+
}
19452015
}

microsoft-azure-storage-test/src/com/microsoft/azure/storage/blob/CloudPageBlobTests.java

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,39 +1242,47 @@ public void testCloudPageBlobSetPremiumBlobTierOnCreate() throws URISyntaxExcept
12421242

12431243
// Test create API
12441244
CloudPageBlob blob = container.getPageBlobReference(blobName);
1245-
assertNull(blob.getProperties().getInferredBlobTier());
1245+
assertNull(blob.getProperties().isBlobTierInferred());
12461246
blob.create(1024, PremiumPageBlobTier.P4, null, null, null);
12471247
assertEquals(PremiumPageBlobTier.P4, blob.getProperties().getPremiumPageBlobTier());
1248-
assertFalse(blob.getProperties().getInferredBlobTier());
1248+
assertFalse(blob.getProperties().isBlobTierInferred());
1249+
assertNull(blob.getProperties().getStandardBlobTier());
1250+
assertNull(blob.getProperties().getRehydrationStatus());
12491251

12501252
CloudPageBlob blob2 = container.getPageBlobReference(blobName);
12511253
blob2.downloadAttributes();
12521254
assertEquals(PremiumPageBlobTier.P4, blob2.getProperties().getPremiumPageBlobTier());
1253-
assertNull(blob2.getProperties().getInferredBlobTier());
1255+
assertNull(blob2.getProperties().isBlobTierInferred());
1256+
assertNull(blob2.getProperties().getStandardBlobTier());
1257+
assertNull(blob2.getProperties().getRehydrationStatus());
12541258

12551259
// Test upload from byte array API
12561260
byte[] buffer = BlobTestHelper.getRandomBuffer(1024);
12571261
CloudPageBlob blob3 = container.getPageBlobReference("blob3");
12581262
blob3.uploadFromByteArray(buffer, 0, 1024, PremiumPageBlobTier.P6, null, null, null);
12591263
assertEquals(PremiumPageBlobTier.P6, blob3.getProperties().getPremiumPageBlobTier());
1260-
assertFalse(blob3.getProperties().getInferredBlobTier());
1264+
assertFalse(blob3.getProperties().isBlobTierInferred());
1265+
assertNull(blob3.getProperties().getStandardBlobTier());
1266+
assertNull(blob3.getProperties().getRehydrationStatus());
12611267

12621268
CloudPageBlob blob3Ref = container.getPageBlobReference("blob3");
12631269
blob3Ref.downloadAttributes();
12641270
assertEquals(PremiumPageBlobTier.P6, blob3Ref.getProperties().getPremiumPageBlobTier());
1265-
assertNull(blob3Ref.getProperties().getInferredBlobTier());
1271+
assertNull(blob3Ref.getProperties().isBlobTierInferred());
12661272

12671273
// Test upload from stream API
12681274
ByteArrayInputStream srcStream = new ByteArrayInputStream(buffer);
12691275
CloudPageBlob blob4 = container.getPageBlobReference("blob4");
12701276
blob4.upload(srcStream, 1024, PremiumPageBlobTier.P10, null, null, null);
12711277
assertEquals(PremiumPageBlobTier.P10, blob4.getProperties().getPremiumPageBlobTier());
1272-
assertFalse(blob4.getProperties().getInferredBlobTier());
1278+
assertFalse(blob4.getProperties().isBlobTierInferred());
1279+
assertNull(blob4.getProperties().getStandardBlobTier());
1280+
assertNull(blob4.getProperties().getRehydrationStatus());
12731281

12741282
CloudPageBlob blob4Ref = container.getPageBlobReference("blob4");
12751283
blob4Ref.downloadAttributes();
12761284
assertEquals(PremiumPageBlobTier.P10, blob4Ref.getProperties().getPremiumPageBlobTier());
1277-
assertNull(blob4Ref.getProperties().getInferredBlobTier());
1285+
assertNull(blob4Ref.getProperties().isBlobTierInferred());
12781286

12791287
// Test upload from file API
12801288
File sourceFile = File.createTempFile("sourceFile", ".tmp");
@@ -1286,12 +1294,14 @@ public void testCloudPageBlobSetPremiumBlobTierOnCreate() throws URISyntaxExcept
12861294
CloudPageBlob blob5 = container.getPageBlobReference("blob5");
12871295
blob5.uploadFromFile(sourceFile.getAbsolutePath(), PremiumPageBlobTier.P20, null, null, null);
12881296
assertEquals(PremiumPageBlobTier.P20, blob5.getProperties().getPremiumPageBlobTier());
1289-
assertFalse(blob5.getProperties().getInferredBlobTier());
1297+
assertFalse(blob5.getProperties().isBlobTierInferred());
1298+
assertNull(blob5.getProperties().getStandardBlobTier());
1299+
assertNull(blob5.getProperties().getRehydrationStatus());
12901300

12911301
CloudPageBlob blob5Ref = container.getPageBlobReference("blob5");
12921302
blob5Ref.downloadAttributes();
12931303
assertEquals(PremiumPageBlobTier.P20, blob5Ref.getProperties().getPremiumPageBlobTier());
1294-
assertNull(blob5Ref.getProperties().getInferredBlobTier());
1304+
assertNull(blob5Ref.getProperties().isBlobTierInferred());
12951305
}
12961306
finally {
12971307
container.deleteIfExists();
@@ -1307,19 +1317,21 @@ public void testCloudPageBlobSetBlobTier() throws URISyntaxException, StorageExc
13071317
String blobName = BlobTestHelper.generateRandomBlobNameWithPrefix("testblob");
13081318
CloudPageBlob blob = container.getPageBlobReference(blobName);
13091319
blob.create(1024);
1310-
assertNull(blob.getProperties().getInferredBlobTier());
1320+
assertNull(blob.getProperties().isBlobTierInferred());
13111321
blob.downloadAttributes();
1312-
assertTrue(blob.getProperties().getInferredBlobTier());
1322+
assertTrue(blob.getProperties().isBlobTierInferred());
13131323
assertEquals(PremiumPageBlobTier.P10, blob.getProperties().getPremiumPageBlobTier());
13141324

13151325
blob.uploadPremiumPageBlobTier(PremiumPageBlobTier.P40);
13161326
assertEquals(PremiumPageBlobTier.P40, blob.properties.getPremiumPageBlobTier());
1317-
assertFalse(blob.getProperties().getInferredBlobTier());
1327+
assertFalse(blob.getProperties().isBlobTierInferred());
1328+
assertNull(blob.getProperties().getStandardBlobTier());
1329+
assertNull(blob.getProperties().getRehydrationStatus());
13181330

13191331
CloudPageBlob blob2 = container.getPageBlobReference(blobName);
13201332
blob2.downloadAttributes();
13211333
assertEquals(PremiumPageBlobTier.P40, blob2.properties.getPremiumPageBlobTier());
1322-
assertNull(blob2.getProperties().getInferredBlobTier());
1334+
assertNull(blob2.getProperties().isBlobTierInferred());
13231335

13241336
boolean pageBlobWithTierFound = false;
13251337
for (ListBlobItem blobItem : container.listBlobs()) {
@@ -1328,7 +1340,9 @@ public void testCloudPageBlobSetBlobTier() throws URISyntaxException, StorageExc
13281340
if (blob.getName().equals(blobName) && !pageBlobWithTierFound) {
13291341
// Check that the blob is found exactly once
13301342
assertEquals(PremiumPageBlobTier.P40, blob3.properties.getPremiumPageBlobTier());
1331-
assertFalse(blob3.getProperties().getInferredBlobTier());
1343+
assertNull(blob3.getProperties().isBlobTierInferred());
1344+
assertNull(blob3.getProperties().getStandardBlobTier());
1345+
assertNull(blob3.getProperties().getRehydrationStatus());
13321346
pageBlobWithTierFound = true;
13331347
} else if (blob.getName().equals(blobName)) {
13341348
fail("Page blob found twice");
@@ -1379,14 +1393,18 @@ public void testCloudPageBlobSetBlobTierOnCopy() throws URISyntaxException, Stor
13791393
assertEquals(BlobType.PAGE_BLOB, copy.getProperties().getBlobType());
13801394
assertEquals(PremiumPageBlobTier.P30, copy.getProperties().getPremiumPageBlobTier());
13811395
assertEquals(PremiumPageBlobTier.P10, source.getProperties().getPremiumPageBlobTier());
1382-
assertFalse(source.getProperties().getInferredBlobTier());
1383-
assertFalse(copy.getProperties().getInferredBlobTier());
1396+
assertFalse(source.getProperties().isBlobTierInferred());
1397+
assertFalse(copy.getProperties().isBlobTierInferred());
1398+
assertNull(source.getProperties().getStandardBlobTier());
1399+
assertNull(source.getProperties().getRehydrationStatus());
1400+
assertNull(copy.getProperties().getStandardBlobTier());
1401+
assertNull(copy.getProperties().getRehydrationStatus());
13841402
BlobTestHelper.waitForCopy(copy);
13851403

13861404
CloudPageBlob copyRef = container.getPageBlobReference("copy");
13871405
copyRef.downloadAttributes();
13881406
assertEquals(PremiumPageBlobTier.P30, copyRef.getProperties().getPremiumPageBlobTier());
1389-
assertNull(copyRef.getProperties().getInferredBlobTier());
1407+
assertNull(copyRef.getProperties().isBlobTierInferred());
13901408

13911409
// copy where source does not have a tier
13921410
CloudPageBlob source2 = container.getPageBlobReference("source2");
@@ -1397,8 +1415,12 @@ public void testCloudPageBlobSetBlobTierOnCopy() throws URISyntaxException, Stor
13971415
assertEquals(BlobType.PAGE_BLOB, copy3.getProperties().getBlobType());
13981416
assertEquals(PremiumPageBlobTier.P60, copy3.getProperties().getPremiumPageBlobTier());
13991417
assertNull(source2.getProperties().getPremiumPageBlobTier());
1400-
assertNull(source2.getProperties().getInferredBlobTier());
1401-
assertFalse(copy3.getProperties().getInferredBlobTier());
1418+
assertNull(source2.getProperties().isBlobTierInferred());
1419+
assertFalse(copy3.getProperties().isBlobTierInferred());
1420+
assertNull(source2.getProperties().getStandardBlobTier());
1421+
assertNull(source2.getProperties().getRehydrationStatus());
1422+
assertNull(copy3.getProperties().getStandardBlobTier());
1423+
assertNull(copy3.getProperties().getRehydrationStatus());
14021424
}
14031425
finally {
14041426
container.deleteIfExists();

0 commit comments

Comments
 (0)