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

Commit 07fba08

Browse files
authored
Merge pull request #328 from Azure/mar18
Mar18
2 parents fb797cc + 4da5b22 commit 07fba08

30 files changed

+1512
-186
lines changed

BreakingChanges.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
Changes in 7.0.0
1+
Changes in 8.0.0
2+
3+
OTHER
4+
* Upgraded the language version to Java 7.
5+
* Updated the Jackson-Core dependency to version 2.9.4 to pull in security fix.
6+
7+
Changes in 7.0.0
28

39
OTHER
410
* Upgraded Key Vault dependency to 1.0. Users of the IKey and IKeyResolver interfaces should note the interface changes in this version.

ChangeLog.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2018.06.26 Version 8.0.0
2+
* Support for 2018-03-28 REST version. Please see our REST API documentation and blogs for information about the related added features.
3+
* Added support for static website properties.
4+
* Added support for the getAccountInfo feature. Sku name and account kind may be retrieved using a CloudBlobClient, CloudBlobContainer, or CloudBlob with SharedKey or SAS.
5+
* Added support for putBlockFromURI. A block may be created with another block blob as its source.
6+
* Upgraded the language version to Java 7.
7+
* Updated the Jackson-Core dependency to version 2.9.4 to pull in security fix.
8+
19
2018.05.22 Version 7.1.0
210
* Support for 2017-11-09 REST version. Please see our REST API documentation and blogs for information about the related added features.
311
* Added OAuth token support for authentication with HTTPS requests.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w
3232
<dependency>
3333
<groupId>com.microsoft.azure</groupId>
3434
<artifactId>azure-storage</artifactId>
35-
<version>7.0.0</version>
35+
<version>8.0.0</version>
3636
</dependency>
3737
```
3838

@@ -50,7 +50,7 @@ To download a copy of the source code, click "Download ZIP" on the right side of
5050

5151
## Minimum Requirements
5252

53-
* Java 1.6+
53+
* Java 1.7+
5454
* [Jackson-Core](https://github.com/FasterXML/jackson-core) is used for JSON parsing.
5555
* (Optional) [SLF4J](http://www.slf4j.org/) is a logging facade.
5656
* (Optional) [SLF4J binding](http://www.slf4j.org/manual.html) is used to associate a specific logging framework with SLF4J.

microsoft-azure-storage-samples/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<artifactId>maven-compiler-plugin</artifactId>
1717
<version>3.0</version>
1818
<configuration>
19-
<source>1.6</source>
20-
<target>1.6</target>
19+
<source>1.7</source>
20+
<target>1.7</target>
2121
</configuration>
2222
</plugin>
2323
</plugins>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<artifactId>maven-compiler-plugin</artifactId>
1717
<version>3.0</version>
1818
<configuration>
19-
<source>1.6</source>
20-
<target>1.6</target>
19+
<source>1.7</source>
20+
<target>1.7</target>
2121
</configuration>
2222
</plugin>
2323
</plugins>

microsoft-azure-storage-test/res/TestConfigurations.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<TestConfigurations>
22
<TargetTestTenant>ProductionTenant</TargetTestTenant>
33
<TargetPremiumBlobTenant>ProductionTenant</TargetPremiumBlobTenant>
4+
<TargetCopySourceTenant>ProductionTenant</TargetCopySourceTenant>
45
<TenantConfigurations>
56
<TenantConfiguration>
67
<TenantName>DevStore</TenantName>

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

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.microsoft.azure.storage.TestRunners.CloudTests;
2424
import com.microsoft.azure.storage.TestRunners.DevFabricTests;
2525
import com.microsoft.azure.storage.TestRunners.DevStoreTests;
26-
import com.microsoft.azure.storage.TestRunners.SlowTests;
2726

2827
import org.junit.Test;
2928
import org.junit.experimental.categories.Category;
@@ -49,6 +48,7 @@ public void testAnalyticsDisable() throws StorageException, InterruptedException
4948
ServiceClient client = TestHelper.createCloudBlobClient();
5049
ServiceProperties props = new ServiceProperties();
5150
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
51+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
5252
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
5353
testAnalyticsDisable(client, props);
5454

@@ -93,6 +93,7 @@ public void testAnalyticsDefaultServiceVersion() throws StorageException, Interr
9393
ServiceClient client = TestHelper.createCloudBlobClient();
9494
ServiceProperties props = new ServiceProperties();
9595
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
96+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
9697
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
9798
testAnalyticsDefaultServiceVersion(client, props);
9899

@@ -154,6 +155,7 @@ public void testAnalyticsLoggingOperations() throws StorageException, Interrupte
154155
ServiceClient client = TestHelper.createCloudBlobClient();
155156
ServiceProperties props = new ServiceProperties();
156157
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
158+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
157159
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
158160
testAnalyticsLoggingOperations(client, props);
159161

@@ -196,6 +198,7 @@ public void testAnalyticsHourMetricsLevel() throws StorageException, Interrupted
196198
ServiceProperties props = new ServiceProperties();
197199
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
198200
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
201+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
199202
testAnalyticsHourMetricsLevel(client, props, null);
200203

201204
client = TestHelper.createCloudQueueClient();
@@ -264,6 +267,7 @@ public void testAnalyticsMinuteMetricsLevel() throws StorageException, Interrupt
264267
ServiceClient client = TestHelper.createCloudBlobClient();
265268
ServiceProperties props = new ServiceProperties();
266269
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
270+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
267271
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
268272
testAnalyticsMinuteMetricsLevel(client, props, null);
269273

@@ -333,6 +337,7 @@ public void testAnalyticsRetentionPolicies() throws StorageException, Interrupte
333337
ServiceClient client = TestHelper.createCloudBlobClient();
334338
ServiceProperties props = new ServiceProperties();
335339
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
340+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
336341
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
337342
testAnalyticsRetentionPolicies(client, props);
338343

@@ -434,6 +439,7 @@ private void testValidDeleteRetentionPolicy(ServiceClient client, boolean enable
434439
ServiceProperties expectedServiceProperties = new ServiceProperties();
435440
expectedServiceProperties.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
436441
expectedServiceProperties.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
442+
expectedServiceProperties.setStaticWebsiteProperties(new StaticWebsiteProperties());
437443

438444
if (enabled) {
439445
expectedServiceProperties.getDeleteRetentionPolicy().setEnabled(true);
@@ -532,6 +538,7 @@ public void testEmptyDeleteRetentionPolicy() throws StorageException, Interrupte
532538
ServiceProperties currentServiceProperties = new ServiceProperties();
533539
currentServiceProperties.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
534540
currentServiceProperties.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
541+
currentServiceProperties.setStaticWebsiteProperties(new StaticWebsiteProperties());
535542
currentServiceProperties.getDeleteRetentionPolicy().setEnabled(true);
536543
currentServiceProperties.getDeleteRetentionPolicy().setRetentionIntervalInDays(5);
537544
callUploadServiceProps(client, currentServiceProperties, null);
@@ -554,6 +561,79 @@ public void testEmptyDeleteRetentionPolicy() throws StorageException, Interrupte
554561
}
555562
}
556563

564+
@Test
565+
public void testValidStaticWebsiteProperties() throws StorageException, InterruptedException {
566+
ServiceClient client = TestHelper.createCloudBlobClient();
567+
// average setting
568+
testValidStaticWebsiteProperties(client, true, "index.html", "errors/error/404error.html");
569+
570+
// disabled setting
571+
testValidStaticWebsiteProperties(client, false, "index.html", "errors/error/404error.html");
572+
}
573+
574+
private void testValidStaticWebsiteProperties(ServiceClient client, boolean enabled, String index, String pathTo404) throws InterruptedException, StorageException {
575+
try {
576+
ServiceProperties expectedServiceProperties = new ServiceProperties();
577+
expectedServiceProperties.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
578+
expectedServiceProperties.setStaticWebsiteProperties(new StaticWebsiteProperties());
579+
expectedServiceProperties.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
580+
581+
if (enabled) {
582+
expectedServiceProperties.getStaticWebsiteProperties().setEnabled(true);
583+
expectedServiceProperties.getStaticWebsiteProperties().setIndexDocument(index);
584+
expectedServiceProperties.getStaticWebsiteProperties().setErrorDocument404Path(pathTo404);
585+
callUploadServiceProps(client, expectedServiceProperties, null);
586+
} else {
587+
// index document and error document path will be ignored by the service when the properties are not enabled.
588+
ServiceProperties propertiesToUpload = new ServiceProperties();
589+
propertiesToUpload.setStaticWebsiteProperties(new StaticWebsiteProperties());
590+
propertiesToUpload.getStaticWebsiteProperties().setIndexDocument(index);
591+
propertiesToUpload.getStaticWebsiteProperties().setErrorDocument404Path(pathTo404);
592+
593+
expectedServiceProperties.getStaticWebsiteProperties().setEnabled(false);
594+
callUploadServiceProps(client, propertiesToUpload, null);
595+
}
596+
597+
// verify
598+
assertServicePropertiesAreEqual(expectedServiceProperties, callDownloadServiceProperties(client));
599+
}
600+
finally {
601+
// disable the static websites
602+
ServiceProperties disabledStaticWebsiteProperties = new ServiceProperties();
603+
disabledStaticWebsiteProperties.setStaticWebsiteProperties(new StaticWebsiteProperties());
604+
callUploadServiceProps(client, disabledStaticWebsiteProperties, null);
605+
}
606+
}
607+
608+
@Test
609+
public void testEmptyStaticWebsiteProperties() throws StorageException, InterruptedException {
610+
ServiceClient client = TestHelper.createCloudBlobClient();
611+
612+
// set up initial static website properties
613+
ServiceProperties currentServiceProperties = new ServiceProperties();
614+
StaticWebsiteProperties properties = new StaticWebsiteProperties();
615+
properties.setEnabled(true);
616+
properties.setIndexDocument("index.html");
617+
properties.setErrorDocument404Path("path/to/404");
618+
currentServiceProperties.setStaticWebsiteProperties(properties);
619+
currentServiceProperties.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
620+
currentServiceProperties.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
621+
callUploadServiceProps(client, currentServiceProperties, null);
622+
623+
// verify
624+
assertServicePropertiesAreEqual(currentServiceProperties, callDownloadServiceProperties(client));
625+
626+
// try to upload empty properties
627+
ServiceProperties emptyServiceProperties = new ServiceProperties();
628+
emptyServiceProperties.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
629+
emptyServiceProperties.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
630+
emptyServiceProperties.setStaticWebsiteProperties(new StaticWebsiteProperties());
631+
callUploadServiceProps(client, emptyServiceProperties, null);
632+
633+
// verify
634+
assertServicePropertiesAreEqual(emptyServiceProperties, callDownloadServiceProperties(client));
635+
}
636+
557637
/**
558638
* Test CORS with different rules.
559639
*
@@ -565,6 +645,7 @@ public void testCloudValidCorsRules() throws StorageException, InterruptedExcept
565645
ServiceClient client = TestHelper.createCloudBlobClient();
566646
ServiceProperties props = new ServiceProperties();
567647
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
648+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
568649
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
569650
testCloudValidCorsRules(client, props, null);
570651

@@ -689,6 +770,7 @@ public void testCorsExpectedExceptions() throws StorageException {
689770
ServiceClient client = TestHelper.createCloudBlobClient();
690771
ServiceProperties props = new ServiceProperties();
691772
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
773+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
692774
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
693775
testCorsExpectedExceptions(client, props, null);
694776

@@ -753,6 +835,7 @@ public void testCorsMaxOrigins() throws StorageException, InterruptedException {
753835
ServiceClient client = TestHelper.createCloudBlobClient();
754836
ServiceProperties props = new ServiceProperties();
755837
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
838+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
756839
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
757840
testCorsMaxOrigins(client, props, null);
758841

@@ -805,6 +888,7 @@ public void testCorsMaxHeaders() throws StorageException, InterruptedException {
805888
ServiceClient client = TestHelper.createCloudBlobClient();
806889
ServiceProperties props = new ServiceProperties();
807890
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
891+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
808892
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
809893
testCorsMaxHeaders(client, props, null);
810894

@@ -909,6 +993,7 @@ public void testOptionalServiceProperties() throws StorageException, Interrupted
909993
ServiceClient client = TestHelper.createCloudBlobClient();
910994
ServiceProperties props = new ServiceProperties();
911995
props.setDeleteRetentionPolicy(new DeleteRetentionPolicy());
996+
props.setStaticWebsiteProperties(new StaticWebsiteProperties());
912997
props.setDefaultServiceVersion(Constants.HeaderConstants.TARGET_STORAGE_VERSION);
913998
testOptionalServiceProperties(client, props);
914999

@@ -991,7 +1076,7 @@ else if (client.getClass().equals(CloudFileClient.class)) {
9911076
else {
9921077
fail();
9931078
}
994-
1079+
9951080
// It may take up to 30 seconds for the settings to take effect, but the new properties are immediately
9961081
// visible when querying service properties.
9971082
}
@@ -1144,6 +1229,16 @@ private static void assertServicePropertiesAreEqual(ServiceProperties propsA, Se
11441229
assertNull(propsA.getDeleteRetentionPolicy());
11451230
assertNull(propsB.getDeleteRetentionPolicy());
11461231
}
1232+
1233+
if (propsA.getStaticWebsiteProperties() != null && propsB.getStaticWebsiteProperties() != null) {
1234+
assertEquals(propsA.getStaticWebsiteProperties().getEnabled(), propsB.getStaticWebsiteProperties().getEnabled());
1235+
assertEquals(propsA.getStaticWebsiteProperties().getIndexDocument(), propsB.getStaticWebsiteProperties().getIndexDocument());
1236+
assertEquals(propsA.getStaticWebsiteProperties().getErrorDocument404Path(), propsB.getStaticWebsiteProperties().getErrorDocument404Path());
1237+
}
1238+
else {
1239+
assertNull(propsA.getStaticWebsiteProperties());
1240+
assertNull(propsB.getStaticWebsiteProperties());
1241+
}
11471242
}
11481243

11491244
/**

0 commit comments

Comments
 (0)