Skip to content

Commit

Permalink
Merge pull request #427 from Azure/master
Browse files Browse the repository at this point in the history
push from master to release
  • Loading branch information
xuezhai committed May 9, 2014
2 parents bdb5bab + 56b6ff6 commit 5241d12
Show file tree
Hide file tree
Showing 1,433 changed files with 156,844 additions and 97,242 deletions.
38 changes: 37 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# Azure Tooling #
node_modules

# Eclipse #
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# Other Tooling #
.classpath
.project
target
node_modules
.idea
*.iml

# Mac OS #
.DS_Store
.DS_Store?

# Windows #
Thumbs.db
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2014.04.2 Version 0.5.0
* Add multiple service management modules
* Split the SDK into multiple sub-modules

2013.09.30 Version 0.4.6
* Allow users to set the client-request-id for better tracking/debugging of storage requests. This is set on the OperationContext.
* Prevent a potential arithmetic overflow while calculating the exponential retry back-off interval in storage.
Expand Down
116 changes: 60 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Windows Azure SDK for Java
#Microsoft Azure SDK for 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/).
This project provides a client library in Java that makes it easy to consume Microsoft Azure services. For documentation please see the [Microsoft Azure Java Developer Center](http://azure.microsoft.com/en-us/develop/java/).

#Features

Expand Down Expand Up @@ -38,10 +38,14 @@ This project provides a client library in Java that makes it easy to consume Win
* Add/Get job notifications
* Create/Read/Update/Delete notification endpoints
* Service Management
* Manage affinity groups
* Compute Management
* Web Site Management
* Virtual Network Management
* Storage Management
* Sql Database Management
* Service Runtime
* Retrieve information about the state of your Azure Compute instances


#Getting Started

Expand All @@ -50,7 +54,7 @@ This project provides a client library in Java that makes it easy to consume Win

To get the source code of the SDK via git just type:

git clone git://github.com/WindowsAzure/azure-sdk-for-java.git
git clone git://github.com/Azure/azure-sdk-for-java.git
cd ./azure-sdk-for-java/microsoft-azure-api/
mvn compile

Expand All @@ -71,19 +75,19 @@ within your project you can also have them installed by the Java package manager

* Java 1.6
* (Optional) Maven


##Usage

To use this SDK to call Windows Azure services, you need to first create an
account. To host your Java code in Windows Azure, you additionally need to download
the full Windows Azure SDK for Java - which includes packaging, emulation, and
To use this SDK to call Microsoft Azure services, you need to first create an
account. To host your Java code in Microsoft Azure, you additionally need to download
the full Microsoft Azure SDK for Java - which includes packaging, emulation, and
deployment tools.

##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/).
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://azure.microsoft.com/en-us/develop/java/).

```java
import java.io.*;
Expand All @@ -92,63 +96,63 @@ 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);
}

}
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);
}

}
}
```

#Need Help?

Be sure to check out the Windows Azure [Developer Forums on Stack Overflow](http://go.microsoft.com/fwlink/?LinkId=234489) if you have trouble with the provided code.
Be sure to check out the Microsoft Azure [Developer Forums on Stack Overflow](http://go.microsoft.com/fwlink/?LinkId=234489) if you have trouble with the provided code.

#Contribute Code or Provide Feedback

If you would like to become an active contributor to this project please follow the instructions provided in [Windows Azure Projects Contribution Guidelines](http://windowsazure.github.com/guidelines.html).
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.com/guidelines.html).

If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/WindowsAzure/azure-sdk-for-java/issues) section of the project.
If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-java/issues) section of the project.

#Learn More

* [Windows Azure Java Developer Center](http://www.windowsazure.com/en-us/develop/java/)
* [Microsoft Azure Java Developer Center](http://azure.microsoft.com/en-us/develop/java/)
* [JavaDocs](http://dl.windowsazure.com/javadoc/)

95 changes: 95 additions & 0 deletions core-test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!--
Copyright Microsoft Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-azure-api-parent</artifactId>
<version>0.5.0</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

<artifactId>microsoft-azure-api-core-test</artifactId>
<packaging>jar</packaging>

<name>Microsoft Azure Core Test Client API</name>
<description>API for Testing Microsoft Azure Clients</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
<connection>scm:git:git://github.com/Azure/azure-sdk-for-java.git</connection>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>

<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>microsoft-azure-api-core</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>microsoft-azure-api-management</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>microsoft-azure-api-management-websites</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>microsoft-azure-api-management-storage</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>microsoft-azure-api-management-sql</artifactId>
<version>0.5.0</version>
</dependency>

<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 5241d12

Please sign in to comment.