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

Commit 43a0619

Browse files
author
jofriedm-msft
authored
Merge pull request #226 from Azure/master
Master to Dev
2 parents 64cf5fe + 08b256e commit 43a0619

File tree

16 files changed

+94
-60
lines changed

16 files changed

+94
-60
lines changed

ChangeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2017.11.01 Version 6.1.0
2+
* Added support for the last time the tier was modified.
3+
14
2017.10.06 Version 6.0.0
25
* Added support for taking a snapshot of a share.
36
* IOExceptions wrapping StorageExceptions will now contain the StorageException message in the outer exception.

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>6.0.0</version>
33+
<version>6.1.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>6.0.0</version>
29+
<version>6.1.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>6.0.0</version>
29+
<version>6.1.0</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>

microsoft-azure-storage-test/src/com/microsoft/azure/storage/AccountSasTests.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,6 @@ public void testBlobIPAccountSas() throws InvalidKeyException, StorageException,
208208
}
209209
catch (StorageException ex) {
210210
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, ex.getHttpStatusCode());
211-
212-
final String[] words = ex.getMessage().split(" ");
213-
// final word
214-
String lastWord = words[words.length - 1];
215-
// strip trailing period
216-
lastWord = lastWord.substring(0, lastWord.length() - 1);
217-
218-
sourceIP = new IPRange(lastWord);
219211
}
220212
finally {
221213
this.blobContainer.deleteIfExists();
@@ -340,14 +332,6 @@ public void testFileIPAccountSas() throws InvalidKeyException, StorageException,
340332
}
341333
catch (StorageException ex) {
342334
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, ex.getHttpStatusCode());
343-
344-
final String[] words = ex.getMessage().split(" ");
345-
// final word
346-
String lastWord = words[words.length - 1];
347-
// strip trailing period
348-
lastWord = lastWord.substring(0, lastWord.length() - 1);
349-
350-
sourceIP = new IPRange(lastWord);
351335
}
352336
finally {
353337
this.fileShare.deleteIfExists();
@@ -474,14 +458,6 @@ public void testQueueIPAccountSas()
474458
}
475459
catch (StorageException ex) {
476460
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, ex.getHttpStatusCode());
477-
478-
final String[] words = ex.getMessage().split(" ");
479-
// final word
480-
String lastWord = words[words.length - 1];
481-
// strip trailing period
482-
lastWord = lastWord.substring(0, lastWord.length() - 1);
483-
484-
sourceIP = new IPRange(lastWord);
485461
}
486462
finally {
487463
this.queueQueue.deleteIfExists();
@@ -608,14 +584,6 @@ public void testTableIPAccountSas() throws InvalidKeyException, StorageException
608584
}
609585
catch (StorageException ex) {
610586
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, ex.getHttpStatusCode());
611-
612-
final String[] words = ex.getMessage().split(" ");
613-
// final word
614-
String lastWord = words[words.length - 1];
615-
// strip trailing period
616-
lastWord = lastWord.substring(0, lastWord.length() - 1);
617-
618-
sourceIP = new IPRange(lastWord);
619587
}
620588
finally {
621589
this.tableTable.deleteIfExists();

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,22 +1946,38 @@ public void testCloudBlockBlobUploadStandardTier() throws StorageException, IOEx
19461946
final String blobName = BlobTestHelper.generateRandomBlobNameWithPrefix("testBlob");
19471947
final CloudBlockBlob blob = this.container.getBlockBlobReference(blobName);
19481948
blob.uploadText("text");
1949+
blob.downloadAttributes();
1950+
assertNotNull(blob.getProperties().getStandardBlobTier());
1951+
assertNull(blob.getProperties().getPremiumPageBlobTier());
1952+
assertTrue(blob.getProperties().isBlobTierInferred());
1953+
1954+
CloudBlockBlob listBlob = (CloudBlockBlob)this.container.listBlobs().iterator().next();
1955+
assertNotNull(listBlob.getProperties().getStandardBlobTier());
1956+
assertNull(listBlob.getProperties().getPremiumPageBlobTier());
1957+
assertTrue(listBlob.getProperties().isBlobTierInferred());
19491958

19501959
blob.uploadStandardBlobTier(standardBlobTier);
19511960
assertEquals(standardBlobTier, blob.getProperties().getStandardBlobTier());
19521961
assertNull(blob.getProperties().getPremiumPageBlobTier());
19531962
assertNull(blob.getProperties().getRehydrationStatus());
1963+
assertFalse(blob.getProperties().isBlobTierInferred());
1964+
assertNull(blob.getProperties().getTierChangeTime());
19541965

19551966
CloudBlockBlob blob2 = this.container.getBlockBlobReference(blobName);
19561967
blob2.downloadAttributes();
19571968
assertEquals(standardBlobTier, blob2.getProperties().getStandardBlobTier());
19581969
assertNull(blob2.getProperties().getPremiumPageBlobTier());
19591970
assertNull(blob2.getProperties().getRehydrationStatus());
1971+
assertFalse(blob2.getProperties().isBlobTierInferred());
1972+
assertNotNull(blob2.getProperties().getTierChangeTime());
19601973

19611974
CloudBlockBlob blob3 = (CloudBlockBlob)this.container.listBlobs().iterator().next();
19621975
assertEquals(standardBlobTier, blob3.getProperties().getStandardBlobTier());
19631976
assertNull(blob3.getProperties().getPremiumPageBlobTier());
19641977
assertNull(blob3.getProperties().getRehydrationStatus());
1978+
assertNull(blob3.getProperties().isBlobTierInferred());
1979+
assertNotNull(blob3.getProperties().getTierChangeTime());
1980+
assertEquals(blob2.getProperties().getTierChangeTime(), blob3.getProperties().getTierChangeTime());
19651981

19661982
blob.deleteIfExists();
19671983
}
@@ -1984,32 +2000,38 @@ public void testCloudBlockBlobRehydrateBlob() throws StorageException, IOExcepti
19842000
assertNull(blobRef1.getProperties().getRehydrationStatus());
19852001
assertEquals(StandardBlobTier.ARCHIVE, blobRef1.getProperties().getStandardBlobTier());
19862002
assertNull(blobRef1.getProperties().getPremiumPageBlobTier());
2003+
assertNull(blobRef1.getProperties().getTierChangeTime());
19872004

19882005
blob.downloadAttributes();
19892006
assertEquals(RehydrationStatus.PENDING_TO_COOL, blob.getProperties().getRehydrationStatus());
19902007
assertEquals(StandardBlobTier.ARCHIVE, blob.getProperties().getStandardBlobTier());
19912008
assertNull(blob.getProperties().getPremiumPageBlobTier());
2009+
assertNotNull(blob.getProperties().getTierChangeTime());
19922010

19932011
CloudBlockBlob blobRef2 = this.container.getBlockBlobReference(blobName2);
19942012
blobRef2.uploadStandardBlobTier(StandardBlobTier.HOT);
19952013
assertNull(blobRef2.getProperties().getRehydrationStatus());
19962014
assertEquals(StandardBlobTier.ARCHIVE, blobRef2.getProperties().getStandardBlobTier());
19972015
assertNull(blobRef2.getProperties().getPremiumPageBlobTier());
2016+
assertNull(blobRef2.getProperties().getTierChangeTime());
19982017

19992018
blob2.downloadAttributes();
20002019
assertEquals(RehydrationStatus.PENDING_TO_HOT, blob2.getProperties().getRehydrationStatus());
20012020
assertEquals(StandardBlobTier.ARCHIVE, blob2.getProperties().getStandardBlobTier());
20022021
assertNull(blob2.getProperties().getPremiumPageBlobTier());
2022+
assertNotNull(blob2.getProperties().getTierChangeTime());
20032023

20042024
Iterator it = this.container.listBlobs().iterator();
20052025
CloudBlockBlob listBlob = (CloudBlockBlob)it.next();
20062026
assertEquals(RehydrationStatus.PENDING_TO_COOL, listBlob.getProperties().getRehydrationStatus());
20072027
assertEquals(StandardBlobTier.ARCHIVE, listBlob.getProperties().getStandardBlobTier());
20082028
assertNull(listBlob.getProperties().getPremiumPageBlobTier());
2029+
assertNotNull(listBlob.getProperties().getTierChangeTime());
20092030

20102031
CloudBlockBlob listBlob2 = (CloudBlockBlob)it.next();
20112032
assertEquals(RehydrationStatus.PENDING_TO_HOT, listBlob2.getProperties().getRehydrationStatus());
20122033
assertEquals(StandardBlobTier.ARCHIVE, listBlob2.getProperties().getStandardBlobTier());
20132034
assertNull(listBlob2.getProperties().getPremiumPageBlobTier());
2035+
assertNotNull(listBlob2.getProperties().getTierChangeTime());
20142036
}
20152037
}

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ public void testCloudPageBlobSetPremiumBlobTierOnCreate() throws URISyntaxExcept
12521252
CloudPageBlob blob2 = container.getPageBlobReference(blobName);
12531253
blob2.downloadAttributes();
12541254
assertEquals(PremiumPageBlobTier.P4, blob2.getProperties().getPremiumPageBlobTier());
1255-
assertNull(blob2.getProperties().isBlobTierInferred());
1255+
assertFalse(blob2.getProperties().isBlobTierInferred());
12561256
assertNull(blob2.getProperties().getStandardBlobTier());
12571257
assertNull(blob2.getProperties().getRehydrationStatus());
12581258

@@ -1268,7 +1268,7 @@ public void testCloudPageBlobSetPremiumBlobTierOnCreate() throws URISyntaxExcept
12681268
CloudPageBlob blob3Ref = container.getPageBlobReference("blob3");
12691269
blob3Ref.downloadAttributes();
12701270
assertEquals(PremiumPageBlobTier.P6, blob3Ref.getProperties().getPremiumPageBlobTier());
1271-
assertNull(blob3Ref.getProperties().isBlobTierInferred());
1271+
assertFalse(blob3Ref.getProperties().isBlobTierInferred());
12721272

12731273
// Test upload from stream API
12741274
ByteArrayInputStream srcStream = new ByteArrayInputStream(buffer);
@@ -1282,7 +1282,7 @@ public void testCloudPageBlobSetPremiumBlobTierOnCreate() throws URISyntaxExcept
12821282
CloudPageBlob blob4Ref = container.getPageBlobReference("blob4");
12831283
blob4Ref.downloadAttributes();
12841284
assertEquals(PremiumPageBlobTier.P10, blob4Ref.getProperties().getPremiumPageBlobTier());
1285-
assertNull(blob4Ref.getProperties().isBlobTierInferred());
1285+
assertFalse(blob4Ref.getProperties().isBlobTierInferred());
12861286

12871287
// Test upload from file API
12881288
File sourceFile = File.createTempFile("sourceFile", ".tmp");
@@ -1301,7 +1301,7 @@ public void testCloudPageBlobSetPremiumBlobTierOnCreate() throws URISyntaxExcept
13011301
CloudPageBlob blob5Ref = container.getPageBlobReference("blob5");
13021302
blob5Ref.downloadAttributes();
13031303
assertEquals(PremiumPageBlobTier.P20, blob5Ref.getProperties().getPremiumPageBlobTier());
1304-
assertNull(blob5Ref.getProperties().isBlobTierInferred());
1304+
assertFalse(blob5Ref.getProperties().isBlobTierInferred());
13051305
}
13061306
finally {
13071307
container.deleteIfExists();
@@ -1318,6 +1318,10 @@ public void testCloudPageBlobSetBlobTier() throws URISyntaxException, StorageExc
13181318
CloudPageBlob blob = container.getPageBlobReference(blobName);
13191319
blob.create(1024);
13201320
assertNull(blob.getProperties().isBlobTierInferred());
1321+
CloudPageBlob listBlob = (CloudPageBlob)container.listBlobs().iterator().next();
1322+
assertNull(listBlob.getProperties().getStandardBlobTier());
1323+
assertNotNull(listBlob.getProperties().getPremiumPageBlobTier());
1324+
13211325
blob.downloadAttributes();
13221326
assertTrue(blob.getProperties().isBlobTierInferred());
13231327
assertEquals(PremiumPageBlobTier.P10, blob.getProperties().getPremiumPageBlobTier());
@@ -1331,7 +1335,7 @@ public void testCloudPageBlobSetBlobTier() throws URISyntaxException, StorageExc
13311335
CloudPageBlob blob2 = container.getPageBlobReference(blobName);
13321336
blob2.downloadAttributes();
13331337
assertEquals(PremiumPageBlobTier.P40, blob2.properties.getPremiumPageBlobTier());
1334-
assertNull(blob2.getProperties().isBlobTierInferred());
1338+
assertFalse(blob2.getProperties().isBlobTierInferred());
13351339

13361340
boolean pageBlobWithTierFound = false;
13371341
for (ListBlobItem blobItem : container.listBlobs()) {
@@ -1404,7 +1408,7 @@ public void testCloudPageBlobSetBlobTierOnCopy() throws URISyntaxException, Stor
14041408
CloudPageBlob copyRef = container.getPageBlobReference("copy");
14051409
copyRef.downloadAttributes();
14061410
assertEquals(PremiumPageBlobTier.P30, copyRef.getProperties().getPremiumPageBlobTier());
1407-
assertNull(copyRef.getProperties().isBlobTierInferred());
1411+
assertFalse(copyRef.getProperties().isBlobTierInferred());
14081412

14091413
// copy where source does not have a tier
14101414
CloudPageBlob source2 = container.getPageBlobReference("source2");

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,6 @@ public void testIpAcl()
137137
}
138138
catch (StorageException ex) {
139139
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, ex.getHttpStatusCode());
140-
141-
final String[] words = ex.getMessage().split(" ");
142-
// final word
143-
String lastWord = words[words.length - 1];
144-
// strip trailing period
145-
lastWord = lastWord.substring(0, lastWord.length() - 1);
146-
147-
sourceIP = new IPRange(lastWord);
148140
}
149141

150142
// Ensure access attempt from the single allowed IP succeeds

microsoft-azure-storage-test/src/com/microsoft/azure/storage/file/FileSasTests.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,6 @@ public void testIpAcl()
181181
}
182182
catch (StorageException ex) {
183183
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, ex.getHttpStatusCode());
184-
185-
final String[] words = ex.getMessage().split(" ");
186-
// final word
187-
String lastWord = words[words.length - 1];
188-
// strip trailing period
189-
lastWord = lastWord.substring(0, lastWord.length() - 1);
190-
191-
sourceIP = new IPRange(lastWord);
192184
}
193185

194186
// Ensure access attempt from the single allowed IP succeeds

microsoft-azure-storage/src/com/microsoft/azure/storage/Constants.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ public static class HeaderConstants {
661661
/**
662662
* Specifies the value to use for UserAgent header.
663663
*/
664-
public static final String USER_AGENT_VERSION = "6.0.0";
664+
public static final String USER_AGENT_VERSION = "6.1.0";
665665

666666
/**
667667
* The default type for content-type and accept
@@ -899,6 +899,16 @@ public static class QueryConstants {
899899
*/
900900
public static final String ACCESS_TIER = "AccessTier";
901901

902+
/**
903+
* XML element for the access tier change time.
904+
*/
905+
public static final String ACCESS_TIER_CHANGE_TIME = "AccessTierChangeTime";
906+
907+
/**
908+
* XML element for access if the access tier is inferred.
909+
*/
910+
public static final String ACCESS_TIER_INFERRED = "AccessTierInferred";
911+
902912
/**
903913
* XML element for the archive status.
904914
*/

0 commit comments

Comments
 (0)