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

Commit 2d82ab7

Browse files
authored
Merge pull request #309 from Azure/master
Bring master into dev
2 parents 7ec8576 + b3822fd commit 2d82ab7

File tree

26 files changed

+148
-152
lines changed

26 files changed

+148
-152
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Microsoft Azure Storage SDK for Java
22

3-
This project provides a client library in Java that makes it easy to consume Microsoft Azure Storage services. For documentation please see the Microsoft Azure [Java Developer Center](http://azure.microsoft.com/en-us/develop/java/) and the [JavaDocs](http://azure.github.io/azure-storage-java/).
3+
This project provides a client library in Java that makes it easy to consume Microsoft Azure Storage services. For documentation please see the [Storage API doc page](https://docs.microsoft.com/en-us/java/api/overview/azure/storage) and the generated [javadoc](http://azure.github.io/azure-storage-java/).
4+
5+
NOTE: There is a new version of this library in development, which supports asynchronous APIs in a reactive model. This entails a significant architectural overhaul and a redesign of the current interface. If this interests you, please feel free to check it out in the New-Storage-SDK-V10-Preview branch. Feedback is always appreciated. The rest of the document below applies to the existing generally available library.
46

57
> If you are looking for the Azure Storage Android SDK, please visit [https://github.com/Azure/azure-storage-android](https://github.com/Azure/azure-storage-android).
68
@@ -30,7 +32,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w
3032
<dependency>
3133
<groupId>com.microsoft.azure</groupId>
3234
<artifactId>azure-storage</artifactId>
33-
<version>6.1.0</version>
35+
<version>7.0.0</version>
3436
</dependency>
3537
```
3638

@@ -60,7 +62,7 @@ SLF4J is only needed if you enable logging through the OperationContext class. I
6062

6163
## Usage
6264

63-
To use this SDK to call Microsoft Azure storage services, you need to first [create an account](https://account.windowsazure.com/signup).
65+
To use this SDK to call Microsoft Azure storage services, you need to first [create an account](https://azure.microsoft.com/free).
6466

6567
Samples are provided in the microsoft-azure-storage-samples folder. The unit tests in microsoft-azure-storage-test can also be helpful.
6668

@@ -131,7 +133,7 @@ When sending pull requests, please send non-breaking PRs to the dev branch and b
131133

132134
# Learn More
133135

134-
* [Azure Developer Center](http://azure.microsoft.com/en-us/develop/java/)
136+
* [Java on Azure Developer Center](http://azure.microsoft.com/en-us/java/azure)
135137
* [Azure Storage Service](http://azure.microsoft.com/en-us/documentation/services/storage/)
136138
* [Azure Storage Team Blog](http://blogs.msdn.com/b/windowsazurestorage/)
137-
* [JavaDocs](http://azure.github.io/azure-storage-java/)
139+
* [Javadoc](http://azure.github.io/azure-storage-java/)

microsoft-azure-storage-samples/pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,22 @@
2626
<dependency>
2727
<groupId>com.microsoft.azure</groupId>
2828
<artifactId>azure-storage</artifactId>
29-
<version>6.1.0</version>
29+
<version>7.0.0</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>
3333
<artifactId>azure-keyvault-extensions</artifactId>
34-
<version>0.8.0</version>
34+
<version>1.0.0</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>com.microsoft.rest</groupId>
38+
<artifactId>client-runtime</artifactId>
39+
<version>1.2.1</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>com.microsoft.aad</groupId>
43+
<artifactId>adal4j</artifactId>
44+
<version>0.0.2</version>
3545
</dependency>
3646
</dependencies>
3747
</project>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.Random;
2626
import java.util.UUID;
2727

28-
import com.microsoft.azure.keyvault.extensions.RsaKey;
28+
import com.microsoft.azure.keyvault.cryptography.RsaKey;
2929
import com.microsoft.azure.storage.CloudStorageAccount;
3030
import com.microsoft.azure.storage.StorageException;
3131
import com.microsoft.azure.storage.blob.BlobEncryptionPolicy;

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/encryption/keyvault/gettingstarted/KeyVaultGettingStarted.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import com.microsoft.azure.keyvault.extensions.AggregateKeyResolver;
3131
import com.microsoft.azure.keyvault.extensions.CachingKeyResolver;
3232
import com.microsoft.azure.keyvault.extensions.KeyVaultKeyResolver;
33-
import com.microsoft.azure.keyvault.extensions.RsaKey;
33+
import com.microsoft.azure.keyvault.cryptography.RsaKey;
3434
import com.microsoft.azure.storage.CloudStorageAccount;
3535
import com.microsoft.azure.storage.StorageException;
3636
import com.microsoft.azure.storage.blob.BlobEncryptionPolicy;
@@ -44,9 +44,7 @@
4444

4545
public class KeyVaultGettingStarted {
4646

47-
public static void main(String[] args) throws StorageException,
48-
NoSuchAlgorithmException, InterruptedException, ExecutionException,
49-
URISyntaxException, InvalidKeyException, IOException {
47+
public static void main(String[] args) throws Exception {
5048
Utility.printSampleStartInfo("KeyVaultGettingStarted");
5149

5250
// Get the key ID from App.config if it exists.
@@ -86,7 +84,7 @@ public static void main(String[] args) throws StorageException,
8684
keyGen.initialize(1024);
8785
final KeyPair wrapKey = keyGen.generateKeyPair();
8886

89-
RsaKey rsaKey = new RsaKey("rsaKey1", wrapKey);
87+
RsaKey rsaKey = new RsaKey(keyID, wrapKey);
9088
LocalResolver resolver = new LocalResolver();
9189
resolver.add(rsaKey);
9290

@@ -95,8 +93,8 @@ public static void main(String[] args) throws StorageException,
9593
// This helps users to define a plug-in model for all the different key
9694
// providers they support.
9795
AggregateKeyResolver aggregateResolver = new AggregateKeyResolver();
98-
aggregateResolver.Add(resolver);
99-
aggregateResolver.Add(cloudResolver);
96+
aggregateResolver.add(resolver);
97+
aggregateResolver.add(cloudResolver);
10098

10199
// Set up a caching resolver so the secrets can be cached on the client.
102100
// This is the recommended usage

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/encryption/keyvault/keyrotation/gettingstarted/KeyRotationGettingStarted.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939

4040
public class KeyRotationGettingStarted {
4141

42-
public static void main(String[] args) throws StorageException,
43-
InterruptedException, ExecutionException, URISyntaxException,
44-
NoSuchAlgorithmException, InvalidKeyException, IOException {
42+
public static void main(String[] args) throws Exception {
4543
Utility.printSampleStartInfo("KeyRotationGettingStarted");
4644

4745
// Create two secrets and obtain their IDs. This is normally a one-time

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.EnumSet;
2222
import java.util.UUID;
2323

24-
import com.microsoft.azure.keyvault.extensions.RsaKey;
24+
import com.microsoft.azure.keyvault.cryptography.RsaKey;
2525
import com.microsoft.azure.storage.CloudStorageAccount;
2626
import com.microsoft.azure.storage.StorageException;
2727
import com.microsoft.azure.storage.queue.CloudQueue;

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/encryption/table/gettingstarted/attributes/TableGettingStartedAttributes.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616

1717
import java.net.URISyntaxException;
1818
import java.security.InvalidKeyException;
19+
import java.security.KeyPair;
20+
import java.security.KeyPairGenerator;
1921
import java.security.NoSuchAlgorithmException;
2022
import java.util.Date;
2123
import java.util.UUID;
2224

23-
import com.microsoft.azure.keyvault.extensions.RsaKey;
25+
import com.microsoft.azure.keyvault.cryptography.RsaKey;
2426
import com.microsoft.azure.storage.CloudStorageAccount;
2527
import com.microsoft.azure.storage.StorageException;
2628
import com.microsoft.azure.storage.table.CloudTable;
@@ -51,7 +53,10 @@ public static void main(String[] args) throws URISyntaxException,
5153
table.createIfNotExists();
5254

5355
// Create the IKey used for encryption.
54-
RsaKey key = new RsaKey("private:key1");
56+
final KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
57+
keyGen.initialize(1024);
58+
final KeyPair wrapKey = keyGen.generateKeyPair();
59+
RsaKey key = new RsaKey("private:key1", wrapKey);
5560

5661
EncryptedEntity ent = new EncryptedEntity(UUID.randomUUID()
5762
.toString(), String.valueOf(new Date().getTime()));

microsoft-azure-storage-samples/src/com/microsoft/azure/storage/encryption/table/gettingstarted/resolver/TableGettingStartedResolver.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
import java.net.URISyntaxException;
1818
import java.security.InvalidKeyException;
19+
import java.security.KeyPair;
20+
import java.security.KeyPairGenerator;
1921
import java.security.NoSuchAlgorithmException;
2022
import java.util.Date;
2123
import java.util.UUID;
@@ -31,7 +33,7 @@
3133
import com.microsoft.azure.storage.table.TableResult;
3234
import com.microsoft.azure.storage.util.LocalResolver;
3335
import com.microsoft.azure.storage.util.Utility;
34-
import com.microsoft.azure.keyvault.extensions.RsaKey;
36+
import com.microsoft.azure.keyvault.cryptography.RsaKey;
3537
import com.microsoft.azure.storage.CloudStorageAccount;
3638
import com.microsoft.azure.storage.StorageException;
3739

@@ -54,7 +56,10 @@ public static void main(String[] args) throws StorageException,
5456
table.createIfNotExists();
5557

5658
// Create the IKey used for encryption.
57-
RsaKey key = new RsaKey("private:key1");
59+
final KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
60+
keyGen.initialize(1024);
61+
final KeyPair wrapKey = keyGen.generateKeyPair();
62+
RsaKey key = new RsaKey("rsaKey1", wrapKey);
5863

5964
DynamicTableEntity ent = new DynamicTableEntity();
6065
ent.setPartitionKey(UUID.randomUUID().toString());

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
@@ -26,12 +26,12 @@
2626
<dependency>
2727
<groupId>com.microsoft.azure</groupId>
2828
<artifactId>azure-storage</artifactId>
29-
<version>6.1.0</version>
29+
<version>7.0.0</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>
3333
<artifactId>azure-keyvault-extensions</artifactId>
34-
<version>0.8.0</version>
34+
<version>1.0.0</version>
3535
</dependency>
3636
<dependency>
3737
<groupId>org.slf4j</groupId>

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static void main(String[] args) throws InvalidKeyException, URISyntaxExce
8484
// Submit the operation to the table service.
8585
table.execute(insertCustomer1);
8686

87-
// When using JsonNoMetadata the client library will infer the property types(int, double,
87+
// When using JsonNoMetadata the client library will infer the property types(int, double,
8888
// String and some booleans) by inspecting the type information on the POJO entity type
8989
// provided by the client. Additionally, in some scenarios clients may wish to provide
9090
// the property type information at runtime such as when querying with the DynamicTableEntity
@@ -97,15 +97,15 @@ class PropertyResolverClass implements PropertyResolver {
9797
public EdmType propertyResolver(String pk, String rk, String key,
9898
String value) {
9999
if (key.equals("Email")) {
100-
return EdmType.STRING;
101-
}
102-
else if (key.equals("PhoneNumber")) {
103-
return EdmType.STRING;
104-
}
105-
else if (key.equals("Id")) {
106-
return EdmType.GUID;
107-
}
108-
return null;
100+
return EdmType.STRING;
101+
}
102+
else if (key.equals("PhoneNumber")) {
103+
return EdmType.STRING;
104+
}
105+
else if (key.equals("Id")) {
106+
return EdmType.GUID;
107+
}
108+
return null;
109109
}
110110
}
111111

0 commit comments

Comments
 (0)