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

Commit 950761b

Browse files
committed
Merge pull request #40 from emgerner-msft/master
Java Storage Client Library 2.1.0
2 parents 11410dc + 10c185c commit 950761b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1430
-911
lines changed

ChangeLog.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2015.04.01 Version 2.1.0
2+
* Fixed a bug for all listing API's where next() would sometimes throw an exception if hasNext() had not been called even if there were more elements to iterate on.
3+
* Added sequence number to the blob properties. This is populated for page blobs.
4+
* Creating a page blob sets its length property.
5+
* Added support for page blob sequence numbers and sequence number access conditions.
6+
* Fixed a bug in abort copy where the lease access condition was not sent to the service.
7+
* Fixed an issue in startCopyFromBlob where if the URI of the source blob contained certain non-ASCII characters they would not be encoded appropriately. This would result in Authorization failures.
8+
* Fixed a small performance issue in XML serialization.
9+
* Fixed a bug in BlobOutputStream and FileOutputStream where flush added data to a request pool rather than immediately committing it to the Azure service.
10+
* Refactored to remove the blob, queue, and file package dependency on table in the error handling code.
11+
* Added additional client-side logging for REST requests, responses, and errors.
12+
113
2014.12.20 Version 2.0.0
214
* Deprecated getSubDirectoryReference() for blob directories and file directories. Use getDirectoryReference() instead.
315
* Fixed a bug where maxResults was not verified to be positive for list operations.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w
2828
<dependency>
2929
<groupId>com.microsoft.azure</groupId>
3030
<artifactId>azure-storage</artifactId>
31-
<version>2.0.0</version>
31+
<version>2.1.0</version>
3232
</dependency>
3333
```
3434

@@ -130,4 +130,4 @@ If you encounter any bugs with the library please file an issue in the [Issues](
130130
* [Azure Developer Center](http://azure.microsoft.com/en-us/develop/java/)
131131
* [Azure Storage Service](http://azure.microsoft.com/en-us/documentation/services/storage/)
132132
* [Azure Storage Team Blog](http://blogs.msdn.com/b/windowsazurestorage/)
133-
* [JavaDocs](http://dl.windowsazure.com/storage/javadoc)
133+
* [JavaDocs](http://dl.windowsazure.com/storage/javadoc)

microsoft-azure-storage-samples/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<dependency>
2626
<groupId>com.microsoft.azure</groupId>
2727
<artifactId>azure-storage</artifactId>
28-
<version>2.0.0</version>
29-
</dependency>
28+
<version>2.1.0</version>
29+
</dependency>
3030
</dependencies>
3131
</project>

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/blob/gettingstarted/BlobBasics.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import java.net.URISyntaxException;
1818
import java.security.InvalidKeyException;
19+
import java.util.UUID;
1920

2021
import com.microsoft.azure.storage.CloudStorageAccount;
2122
import com.microsoft.azure.storage.blob.BlobContainerPermissions;
@@ -53,7 +54,10 @@ public static void main(String[] args) throws InvalidKeyException, URISyntaxExce
5354
try {
5455
// Get a reference to a container
5556
// The container name must be lower case
56-
CloudBlobContainer container = blobClient.getContainerReference("blobbasicscontainer");
57+
// Append a random UUID to the end of the container name so that
58+
// this sample can be run more than once in quick succession.
59+
CloudBlobContainer container = blobClient.getContainerReference("blobbasicscontainer"
60+
+ UUID.randomUUID().toString().replace("-", ""));
5761

5862
// Create the container if it does not exist
5963
container.createIfNotExists();

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/queue/gettingstarted/QueueBasics.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import java.net.URISyntaxException;
1818
import java.security.InvalidKeyException;
1919
import java.util.EnumSet;
20+
import java.util.UUID;
2021

2122
import com.microsoft.azure.storage.CloudStorageAccount;
2223
import com.microsoft.azure.storage.queue.CloudQueue;
@@ -51,7 +52,10 @@ public static void main(String[] args) throws InvalidKeyException, URISyntaxExce
5152

5253
try {
5354
// Retrieve a reference to a queue
54-
CloudQueue queue = queueClient.getQueueReference("queuebasics");
55+
// Append a random UUID to the end of the queue name so that this
56+
// sample can be run more than once in quick succession.
57+
CloudQueue queue = queueClient.getQueueReference("queuebasics"
58+
+ UUID.randomUUID().toString().replace("-", ""));
5559

5660
// Create the queue if it doesn't already exist
5761
queue.createIfNotExists();

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/table/gettingtstarted/TableBasics.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import java.net.URISyntaxException;
1818
import java.security.InvalidKeyException;
19+
import java.util.UUID;
1920

2021
import com.microsoft.azure.storage.CloudStorageAccount;
2122
import com.microsoft.azure.storage.StorageException;
@@ -56,7 +57,10 @@ public static void main(String[] args) throws InvalidKeyException, URISyntaxExce
5657

5758
try {
5859
// Retrieve a reference to a table.
59-
table = tableClient.getTableReference(tableName);
60+
// Append a random UUID to the end of the table name so that this
61+
// sample can be run more than once in quick succession.
62+
table = tableClient.getTableReference(tableName
63+
+ UUID.randomUUID().toString().replace("-", ""));
6064

6165
// Create the table if it doesn't already exist.
6266
table.createIfNotExists();

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/table/payloadformat/PayloadFormat.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ public static void main(String[] args) throws InvalidKeyException, URISyntaxExce
6464

6565
try {
6666
// Retrieve a reference to a table.
67-
CloudTable table = tableClient.getTableReference("tablepayloadformat");
67+
// Append a random UUID to the end of the table name so that this
68+
// sample can be run more than once in quick succession.
69+
CloudTable table = tableClient.getTableReference("tablepayloadformat"
70+
+ UUID.randomUUID().toString().replace("-", ""));
6871

6972
// Create the table if it doesn't already exist.
7073
table.createIfNotExists();

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/util/Utility.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ public final class Utility {
2929
}
3030

3131
/**
32-
* Stores the storage connection strings.
32+
* MODIFY THIS!
3333
*
34+
* Stores the storage connection string.
3435
*/
35-
public static final String storageConnectionString = "DefaultEndpointsProtocol=http;AccountName=myaccountname;AccountKey=myaccountkey";
36+
public static final String storageConnectionString = "DefaultEndpointsProtocol=https;"
37+
+ "AccountName=[MY_ACCOUNT_NAME];"
38+
+ "AccountKey=[MY_ACCOUNT_KEY]";
3639

3740
/**
3841
* Prints out the exception information .

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -789,14 +789,6 @@ else if (client.getClass().equals(CloudQueueClient.class)) {
789789

790790
/**
791791
* Takes a CorsRule and tries to upload it. Then tries to download it and compares it to the initial CorsRule.
792-
*
793-
* @param rule
794-
* @param client
795-
* TODO
796-
* @param props
797-
* TODO
798-
* @throws StorageException
799-
* @throws InterruptedException
800792
*/
801793
private void testCorsRules(CorsRule rule, ServiceClient client, ServiceProperties props) throws StorageException,
802794
InterruptedException {
@@ -811,15 +803,6 @@ private void testCorsRules(CorsRule rule, ServiceClient client, ServicePropertie
811803
/**
812804
* Takes a List of CorsRules and tries to upload them. Then tries to download them and compares the list to the
813805
* initial CorsRule List.
814-
*
815-
* @param client
816-
* TODO
817-
* @param props
818-
* TODO
819-
* @param rule
820-
*
821-
* @throws StorageException
822-
* @throws InterruptedException
823806
*/
824807
private void testCorsRules(List<CorsRule> corsRules, ServiceClient client, ServiceProperties props)
825808
throws StorageException, InterruptedException {
@@ -836,9 +819,6 @@ private void testCorsRules(List<CorsRule> corsRules, ServiceClient client, Servi
836819

837820
/**
838821
* Checks two ServiceProperties for equality
839-
*
840-
* @param propsA
841-
* @param propsB
842822
*/
843823
private static void assertServicePropertiesAreEqual(ServiceProperties propsA, ServiceProperties propsB) {
844824
if (propsA.getLogging() != null && propsB.getLogging() != null) {

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,15 @@ public void testStorageCredentialsSharedKey() throws URISyntaxException, Storage
7878

7979
@Test
8080
public void testStorageCredentialsSAS() throws URISyntaxException, StorageException {
81-
String token = "?sp=abcde&api-version=2014-02-14&sig=1";
82-
81+
String token = "?sig=1&api-version=2014-02-14&sp=abcde";
8382
StorageCredentialsSharedAccessSignature cred = new StorageCredentialsSharedAccessSignature(token);
84-
8583
assertNull(cred.getAccountName());
8684

8785
URI testUri = new URI("http://test/abc");
8886
assertEquals(testUri + token, cred.transformUri(testUri).toString());
8987

9088
testUri = new URI("http://test/abc?query=a&query2=b");
91-
String expectedUri = "http://test/abc?sp=abcde&query=a&api-version=2014-02-14&query2=b&sig=1";
89+
String expectedUri = "http://test/abc?sig=1&api-version=2014-02-14&query=a&sp=abcde&query2=b";
9290
assertEquals(expectedUri, cred.transformUri(testUri).toString());
9391
}
9492

0 commit comments

Comments
 (0)