From 2f3d432022ad69db0df94c264d99f19efeb501e5 Mon Sep 17 00:00:00 2001 From: Guang Yang Date: Wed, 8 May 2013 19:16:05 -0700 Subject: [PATCH 1/6] update for 0.4.3 --- README.md | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index a8805eb2e3262..36c1db7012323 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,37 @@ #Windows Azure SDK for Java -This SDK allows you to build Windows Azure applications in Java that allow -you to take advantage of Azure scalable cloud computing resources: table and blob -storage, messaging through Service Bus. - -For documentation please see the [Windows Azure Java Developer Center](http://www.windowsazure.com/en-us/develop/java/) +This project provides a client library in Java that makes it easy to consume Windows Azure services. For documentation please see the [Windows Azure Java Developer Center](http://www.windowsazure.com/en-us/develop/java/). #Features -* Blob - * Create/Read/Update/Delete Blobs -* Queue - * Create/Delete Queues - * Insert/Peek Queue Messages - * Advanced Queue Operations -* Media Services - * Upload Media Files to Media Services - * Change the encoding on uploaded Media Services - * Provide streaming or download access to uploaded/transformed Media Files + +* Storage + * Blob + * Create/Read/Update/Delete containers + * Create/Read/Update/Delete blobs + * Queue + * Create/Delete Queues + * Insert/Peek Queue Messages + * Advanced Queue Operations + * Table + * Create/Read/Update/Delete tables + * Create/Read/Update/Delete entities + * Batch operation * Service Bus - * Use either the Queue or Topic/Subscription Model + * Queues + * Create/Read/Update/Delete queues + * Send/Receive/Unlock/Delete messages + * Topics + * Create/Read/Update/Delete topics + * Create/Read/Update/Delete subscriptions + * Create/Read/Update/Delete rules + * Send/Receive/Unlock/Delete messages +* Media Services + * Upload Media Files to Media Services + * Change the encoding on uploaded Media Services + * Provide streaming or download access to uploaded/transformed Media Files * Service Runtime - * Retrieve information about the state of your Azure Compute instances -* Table - * Manage Tables - * Table Entity Operations - * Entity Group Transactions (Batch) + * Retrieve information about the state of your Azure Compute instances + #Getting Started @@ -45,7 +52,7 @@ within your project you can also have them installed by the Java package manager com.microsoft.windowsazure microsoft-windowsazure-api - 0.4.2 + 0.4.3 ##Minimum Requirements From 048a1196418555c0fa695a4c5f27d7647eceb00a Mon Sep 17 00:00:00 2001 From: Guang Yang Date: Wed, 22 May 2013 12:18:55 -0700 Subject: [PATCH 2/6] update based on code review feedback --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 36c1db7012323..6c2ed9bf03431 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,19 @@ This project provides a client library in Java that makes it easy to consume Win * Queues * Create/Read/Update/Delete queues * Send/Receive/Unlock/Delete messages + * Renew message lock * Topics * Create/Read/Update/Delete topics * Create/Read/Update/Delete subscriptions * Create/Read/Update/Delete rules * Send/Receive/Unlock/Delete messages + * Renew message lock * Media Services - * Upload Media Files to Media Services - * Change the encoding on uploaded Media Services - * Provide streaming or download access to uploaded/transformed Media Files + * Create/Read/Update/Delete access policies + * Create/Read/Update/Delete asset files + * Create/Read/Update/Delete assets + * Create/Read/Update/Delete/Rebind content keys + * Create/Read/Update/Cancel/Delete jobs * Service Runtime * Retrieve information about the state of your Azure Compute instances From ecba1209be10d116014d34703c39024cb588795c Mon Sep 17 00:00:00 2001 From: Anu Bandi Date: Fri, 7 Jun 2013 13:07:22 -0700 Subject: [PATCH 3/6] updated sample code to use containerPermissions. added java & xml formatting --- README.md | 120 ++++++++++++++++++++++++++---------------------------- 1 file changed, 58 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 6c2ed9bf03431..e90ba41e17c10 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,13 @@ To get the source code of the SDK via git just type: To get the binaries of this library as distributed by Microsoft, ready for use within your project you can also have them installed by the Java package manager Maven. - - - com.microsoft.windowsazure - microsoft-windowsazure-api - 0.4.3 - - +```xml + + com.microsoft.windowsazure + microsoft-windowsazure-api + 0.4.3 + +``` ##Minimum Requirements * Java 1.6 @@ -72,67 +72,63 @@ account. To host your Java code in Windows Azure, you additionally need to down the full Windows Azure SDK for Java - which includes packaging, emulation, and deployment tools. -##Code Samples +##Code Sample The following is a quick example on how to set up a Azure blob using the API and uploading a file to it. For additional information on using the client libraries to access Azure services see the How To guides listed [here](http://www.windowsazure.com/en-us/develop/java/). +```java +import java.io.*; + +import com.microsoft.windowsazure.services.core.storage.*; +import com.microsoft.windowsazure.services.blob.client.*; + +public class BlobSample { + public static final String storageConnectionString = + "DefaultEndpointsProtocol=http;" + + "AccountName=your_account_name;" + + "AccountKey= your_account_name"; + + public static void main(String[] args) { + try { + CloudStorageAccount account; + CloudBlobClient serviceClient; + CloudBlobContainer container; + CloudBlockBlob blob; + + account = CloudStorageAccount.parse(storageConnectionString); + serviceClient = account.createCloudBlobClient(); + // Container name must be lower case. + container = serviceClient.getContainerReference("blobsample"); + container.createIfNotExist(); + + // Set anonymous access on the container. + BlobContainerPermissions containerPermissions; + containerPermissions = new BlobContainerPermissions(); + container.uploadPermissions(containerPermissions); + + // Upload an image file. + blob = container.getBlockBlobReference("image1.jpg"); + File fileReference = new File("c:\\myimages\\image1.jpg"); + blob.upload(new FileInputStream(fileReference), + fileReference.length()); + } catch (FileNotFoundException fileNotFoundException) { + System.out.print("FileNotFoundException encountered: "); + System.out.println(fileNotFoundException.getMessage()); + System.exit(-1); + } catch (StorageException storageException) { + System.out.print("StorageException encountered: "); + System.out.println(storageException.getMessage()); + System.exit(-1); + } catch (Exception e) { + System.out.print("Exception encountered: "); + System.out.println(e.getMessage()); + System.exit(-1); + } - import com.microsoft.windowsazure.services.core.storage.*; - import com.microsoft.windowsazure.services.blob.client.*; - - public class BlobSample { - public static final String storageConnectionString = - "DefaultEndpointsProtocol=http;" + - "AccountName=your_account_name;" + - "AccountKey= your_account_name"; - - public static void main(String[] args) - { - try - { - CloudStorageAccount account; - CloudBlobClient serviceClient; - CloudBlobContainer container; - CloudBlockBlob blob; - - account = CloudStorageAccount.parse(storageConnectionString); - serviceClient = account.createCloudBlobClient(); - // Container name must be lower case. - container = serviceClient.getContainerReference("blobsample"); - container.createIfNotExist(); - - // Set anonymous access on the container. - BlobContainerPermissions containerPermissions; - containerPermissions = new BlobContainerPermissions(); - - // Upload an image file. - blob = container.getBlockBlobReference("image1.jpg"); - File fileReference = new File ("c:\\myimages\\image1.jpg"); - blob.upload(new FileInputStream(fileReference), fileReference.length()); - } - catch (FileNotFoundException fileNotFoundException) - { - System.out.print("FileNotFoundException encountered: "); - System.out.println(fileNotFoundException.getMessage()); - System.exit(-1); - } - catch (StorageException storageException) - { - System.out.print("StorageException encountered: "); - System.out.println(storageException.getMessage()); - System.exit(-1); - } - catch (Exception e) - { - System.out.print("Exception encountered: "); - System.out.println(e.getMessage()); - System.exit(-1); - } - - } } - +} +``` #Need Help? From 55f705584afb73d5f71143359fb0751e27f60d52 Mon Sep 17 00:00:00 2001 From: Anu Bandi Date: Fri, 7 Jun 2013 14:39:21 -0700 Subject: [PATCH 4/6] Revert "updated sample code to use containerPermissions. added java & xml formatting" This reverts commit 57f75cc726c377043e3594aed51317bbfbce22ff. --- README.md | 120 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index e90ba41e17c10..6c2ed9bf03431 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,13 @@ To get the source code of the SDK via git just type: To get the binaries of this library as distributed by Microsoft, ready for use within your project you can also have them installed by the Java package manager Maven. -```xml - - com.microsoft.windowsazure - microsoft-windowsazure-api - 0.4.3 - -``` + + + com.microsoft.windowsazure + microsoft-windowsazure-api + 0.4.3 + + ##Minimum Requirements * Java 1.6 @@ -72,63 +72,67 @@ account. To host your Java code in Windows Azure, you additionally need to down the full Windows Azure SDK for Java - which includes packaging, emulation, and deployment tools. -##Code Sample +##Code Samples The following is a quick example on how to set up a Azure blob using the API and uploading a file to it. For additional information on using the client libraries to access Azure services see the How To guides listed [here](http://www.windowsazure.com/en-us/develop/java/). -```java -import java.io.*; - -import com.microsoft.windowsazure.services.core.storage.*; -import com.microsoft.windowsazure.services.blob.client.*; - -public class BlobSample { - public static final String storageConnectionString = - "DefaultEndpointsProtocol=http;" - + "AccountName=your_account_name;" - + "AccountKey= your_account_name"; - - public static void main(String[] args) { - try { - CloudStorageAccount account; - CloudBlobClient serviceClient; - CloudBlobContainer container; - CloudBlockBlob blob; - - account = CloudStorageAccount.parse(storageConnectionString); - serviceClient = account.createCloudBlobClient(); - // Container name must be lower case. - container = serviceClient.getContainerReference("blobsample"); - container.createIfNotExist(); - - // Set anonymous access on the container. - BlobContainerPermissions containerPermissions; - containerPermissions = new BlobContainerPermissions(); - container.uploadPermissions(containerPermissions); - - // Upload an image file. - blob = container.getBlockBlobReference("image1.jpg"); - File fileReference = new File("c:\\myimages\\image1.jpg"); - blob.upload(new FileInputStream(fileReference), - fileReference.length()); - } catch (FileNotFoundException fileNotFoundException) { - System.out.print("FileNotFoundException encountered: "); - System.out.println(fileNotFoundException.getMessage()); - System.exit(-1); - } catch (StorageException storageException) { - System.out.print("StorageException encountered: "); - System.out.println(storageException.getMessage()); - System.exit(-1); - } catch (Exception e) { - System.out.print("Exception encountered: "); - System.out.println(e.getMessage()); - System.exit(-1); - } + import com.microsoft.windowsazure.services.core.storage.*; + import com.microsoft.windowsazure.services.blob.client.*; + + public class BlobSample { + public static final String storageConnectionString = + "DefaultEndpointsProtocol=http;" + + "AccountName=your_account_name;" + + "AccountKey= your_account_name"; + + public static void main(String[] args) + { + try + { + CloudStorageAccount account; + CloudBlobClient serviceClient; + CloudBlobContainer container; + CloudBlockBlob blob; + + account = CloudStorageAccount.parse(storageConnectionString); + serviceClient = account.createCloudBlobClient(); + // Container name must be lower case. + container = serviceClient.getContainerReference("blobsample"); + container.createIfNotExist(); + + // Set anonymous access on the container. + BlobContainerPermissions containerPermissions; + containerPermissions = new BlobContainerPermissions(); + + // Upload an image file. + blob = container.getBlockBlobReference("image1.jpg"); + File fileReference = new File ("c:\\myimages\\image1.jpg"); + blob.upload(new FileInputStream(fileReference), fileReference.length()); + } + catch (FileNotFoundException fileNotFoundException) + { + System.out.print("FileNotFoundException encountered: "); + System.out.println(fileNotFoundException.getMessage()); + System.exit(-1); + } + catch (StorageException storageException) + { + System.out.print("StorageException encountered: "); + System.out.println(storageException.getMessage()); + System.exit(-1); + } + catch (Exception e) + { + System.out.print("Exception encountered: "); + System.out.println(e.getMessage()); + System.exit(-1); + } + + } } -} -``` + #Need Help? From a6ccec75e44e0fe88990abb8ed922da3de5ed4c0 Mon Sep 17 00:00:00 2001 From: Anu Bandi Date: Mon, 10 Jun 2013 15:14:38 -0700 Subject: [PATCH 5/6] fixed README.md fixes #360 - code sample now uses containerPermissions variable - added java and xml tags for syntax highlighting --- README.md | 117 ++++++++++++++++++++++++++---------------------------- 1 file changed, 57 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index a8805eb2e3262..97d57a4855d2d 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,13 @@ To get the source code of the SDK via git just type: To get the binaries of this library as distributed by Microsoft, ready for use within your project you can also have them installed by the Java package manager Maven. - - com.microsoft.windowsazure - microsoft-windowsazure-api - 0.4.2 - +```xml + + com.microsoft.windowsazure + microsoft-windowsazure-api + 0.4.2 + +``` ##Minimum Requirements @@ -61,67 +63,62 @@ account. To host your Java code in Windows Azure, you additionally need to down the full Windows Azure SDK for Java - which includes packaging, emulation, and deployment tools. -##Code Samples +##Code Sample The following is a quick example on how to set up a Azure blob using the API and uploading a file to it. For additional information on using the client libraries to access Azure services see the How To guides listed [here](http://www.windowsazure.com/en-us/develop/java/). +```java +import java.io.*; + +import com.microsoft.windowsazure.services.core.storage.*; +import com.microsoft.windowsazure.services.blob.client.*; + +public class BlobSample { + public static final String storageConnectionString = + "DefaultEndpointsProtocol=http;" + + "AccountName=your_account_name;" + + "AccountKey= your_account_name"; + + public static void main(String[] args) { + try { + CloudStorageAccount account; + CloudBlobClient serviceClient; + CloudBlobContainer container; + CloudBlockBlob blob; + + account = CloudStorageAccount.parse(storageConnectionString); + serviceClient = account.createCloudBlobClient(); + // Container name must be lower case. + container = serviceClient.getContainerReference("blobsample"); + container.createIfNotExist(); + + // Set anonymous access on the container. + BlobContainerPermissions containerPermissions; + containerPermissions = new BlobContainerPermissions(); + container.uploadPermissions(containerPermissions); + + // Upload an image file. + blob = container.getBlockBlobReference("image1.jpg"); + File fileReference = new File("c:\\myimages\\image1.jpg"); + blob.upload(new FileInputStream(fileReference), fileReference.length()); + } catch (FileNotFoundException fileNotFoundException) { + System.out.print("FileNotFoundException encountered: "); + System.out.println(fileNotFoundException.getMessage()); + System.exit(-1); + } catch (StorageException storageException) { + System.out.print("StorageException encountered: "); + System.out.println(storageException.getMessage()); + System.exit(-1); + } catch (Exception e) { + System.out.print("Exception encountered: "); + System.out.println(e.getMessage()); + System.exit(-1); + } - import com.microsoft.windowsazure.services.core.storage.*; - import com.microsoft.windowsazure.services.blob.client.*; - - public class BlobSample { - public static final String storageConnectionString = - "DefaultEndpointsProtocol=http;" + - "AccountName=your_account_name;" + - "AccountKey= your_account_name"; - - public static void main(String[] args) - { - try - { - CloudStorageAccount account; - CloudBlobClient serviceClient; - CloudBlobContainer container; - CloudBlockBlob blob; - - account = CloudStorageAccount.parse(storageConnectionString); - serviceClient = account.createCloudBlobClient(); - // Container name must be lower case. - container = serviceClient.getContainerReference("blobsample"); - container.createIfNotExist(); - - // Set anonymous access on the container. - BlobContainerPermissions containerPermissions; - containerPermissions = new BlobContainerPermissions(); - - // Upload an image file. - blob = container.getBlockBlobReference("image1.jpg"); - File fileReference = new File ("c:\\myimages\\image1.jpg"); - blob.upload(new FileInputStream(fileReference), fileReference.length()); - } - catch (FileNotFoundException fileNotFoundException) - { - System.out.print("FileNotFoundException encountered: "); - System.out.println(fileNotFoundException.getMessage()); - System.exit(-1); - } - catch (StorageException storageException) - { - System.out.print("StorageException encountered: "); - System.out.println(storageException.getMessage()); - System.exit(-1); - } - catch (Exception e) - { - System.out.print("Exception encountered: "); - System.out.println(e.getMessage()); - System.exit(-1); - } - - } } - +} +``` #Need Help? From 59d4bcb057c8f6b707c1dfa6803b5aeb7ec818c2 Mon Sep 17 00:00:00 2001 From: Anu Bandi Date: Thu, 13 Jun 2013 11:48:20 -0700 Subject: [PATCH 6/6] fixed mislabeled string --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc83347a4da73..f12d7aa79956f 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ public class BlobSample { public static final String storageConnectionString = "DefaultEndpointsProtocol=http;" + "AccountName=your_account_name;" - + "AccountKey= your_account_name"; + + "AccountKey= your_account_key"; public static void main(String[] args) { try {