Skip to content

Commit

Permalink
Merge pull request #378 from WindowsAzure/release
Browse files Browse the repository at this point in the history
pull request from release branch to master branch
  • Loading branch information
xuezhai committed Jul 2, 2013
2 parents c06f38c + 3e97d96 commit 4720f7a
Show file tree
Hide file tree
Showing 54 changed files with 2,055 additions and 319 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2013.07.03 Version 0.4.4
* Windows Azure China environemnt support
* Service Bus metadata support updated to the latest version
* Rich Odata entity query support for Service Bus Queue/Topic/Subscription
* Added support for Service Bus message forwarding
* Added support for Service Bus message count details
* Made sure the response stream is drained to prevent socket exhaustion in Storage
* Added support for all flavors of SharedKey and SharedKeyLite message signing through AuthenticationScheme property on client classes in Storage

2013.05.27 Version 0.4.3
* Added support for updating existing Queue/Topic/Subscription for Service Bus
* Added support for message lock renewal to support long running message processing for Service Bus
Expand Down
119 changes: 59 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ This project provides a client library in Java that makes it easy to consume Win
* Create/Read/Update/Delete queues
* Send/Receive/Unlock/Delete messages
* Renew message lock
* Message forwarding
* Topics
* Create/Read/Update/Delete topics
* Create/Read/Update/Delete subscriptions
* Create/Read/Update/Delete rules
* Send/Receive/Unlock/Delete messages
* Renew message lock
* Message forwarding
* Media Services
* Create/Read/Update/Delete access policies
* Create/Read/Update/Delete asset files
Expand All @@ -53,11 +55,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.

<dependency>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.3</version>
</dependency>
```xml
<dependency>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.4</version>
</dependency>
```

##Minimum Requirements

Expand All @@ -72,67 +76,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_key";

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?

Expand Down
10 changes: 6 additions & 4 deletions microsoft-azure-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
<packaging>jar</packaging>

<name>Microsoft Windows Azure Client API</name>
Expand Down Expand Up @@ -143,7 +143,7 @@
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.0</version>
<version>0.8.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand All @@ -154,16 +154,18 @@
</executions>
<configuration>
<extension>true</extension>
<debug>true</debug>
<verbose>true</verbose>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.0</version>
<version>0.6.4</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>0.6.0</version>
<version>0.6.4</version>
</plugin>
</plugins>

Expand Down
Loading

0 comments on commit 4720f7a

Please sign in to comment.