Skip to content

Commit

Permalink
Merge pull request Azure#9 from emgerner-msft/master
Browse files Browse the repository at this point in the history
0.7.0 release
  • Loading branch information
emgerner-msft committed May 7, 2014
2 parents 184a702 + fd078e8 commit e40cf09
Show file tree
Hide file tree
Showing 259 changed files with 10,657 additions and 12,581 deletions.
37 changes: 37 additions & 0 deletions BreakingChanges.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
Changes in 0.7.0

BLOB
* Removed CloudPageBlob openOutputStream methods in favor of equivalent openWriteNew methods.
* Removed SharedAccessBlobPolicy permissionsFromString(String) and permissionsToString(EnumSet) static methods in favor of setPermissionsFromString(String) and permissionsToString() instance methods.
* Moved LeaseDuration, LeaseState, and LeaseStatus from the storage package to the blob package
* Made the parse(String) methods in LeaseDuration, LeaseState, and LeaseStatus internal
* Removed BlobType enum parse() method
* Removed CopyStatus enum parse() method
* Removed some BlobProperties setter methods (all originally marked "Internal Use Only")
* BlockEntry searchMode field must be accessed through its getter/setter
* Applied MaximumExecutionTime to downloadToByteArray and downloadRangeToByteArray methods
* Deprecated ConcurrentRequestCount and SingleBlobPutThresholdInBytes getters and setters on the blob service client. Use the getters and setters located on the request options object accessible via getDefaultRequestOptions() instead.

QUEUE
* Removed SharedAccessQueuePolicy permissionsFromString(String) and permissionsToString(EnumSet) static methods in favor of setPermissionsFromString(String) and permissionsToString() instance methods.
* Removed CloudQueueMessage setExpirationTime(), setNextVisibleTime() and setPopReceipt() methods

TABLE
* Moved all execute and executeSegmented methods for TableOperations, TableBatchOperations, and TableQueries from CloudTableClient to CloudTable. The CloudTableClient methods are removed.
* Removed SharedAccessTablePolicy permissionsFromString(String) and permissionsToString(EnumSet) static methods in favor of setPermissionsFromString(String) and permissionsToString() instance methods.
* Removed CloudTableClient constructors taking only URI/StorageUri and throw if credentials passed into constructors are null as tables do not allow anonymous access
* Removed TableConstants class
* Deprecated the TablePayloadFormat getter and setter on the table service client. Use the getter and setter located on the request options object accessible via getDefaultRequestOptions() instead.

OTHER
* Changed package name from com.microsoft.windowsazure.storage to com.microsoft.azure.storage
* Removed OperationContext getCurrentRequestObject/setCurrentReqestObject methods
* Removed reserved methods from StorageCredentials classes
* Made the isUsePathStyleUris() method in ServiceClient protected
* RetryContext currentRetryCount and lastRequestResult fields must be accessed with their corresponding getters/setters
* Removed some classes/methods originally marked "Internal Use Only": Credentials.getSigningAccountName(), StorageCredentialsAccountAndKey.setSigningAccountName(), DeserializationHelper class
* Removed GeoReplicationStats.getGeoReplicationStatus(String)
* Deprecated LocationMode, RetryPolicyFactory, TimeoutInMs, and MaximumExecutionTimeInMs getters and setters on the service clients. Use the getters and setters located on the request options object accessible via getDefaultRequestOptions() instead.
* Removed server TimeoutInMs defaults. These are still settable via the DefaultRequestOptions object on the client if desired.
* Whitespace only metadata values are no longer accepted

Changes in 0.6.0

BLOB
Expand Down
36 changes: 36 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
2014.05.06 Version 0.7.0
* Created a DefaultRequestOptions object for each service client
* Deprecated getter/setters for all request option properties on the service clients
* Removed server timeout defaults. These are still settable via the DefaultRequestOptions object on the client if desired
* Removed OperationContext getCurrentRequestObject/setCurrentReqestObject methods
* Removed SharedAccess{Blob|Queue|Table}Policy permissionsFromString(String) and permissionsToString(EnumSet) static methods in favor of setPermissionsFromString(String) and permissionsToString() instance methods
* Moved all execute and executeSegmented methods for TableOperations, TableBatchOperations, and TableQueries from CloudTableClient to CloudTable. The CloudTableClient methods are removed
* Deprecated getEntityClass() in TableQuery. Please use getClazzType() instead.
* Removed CloudPageBlob openOutputStream methods in favor of equivalent openWriteNew methods
* Removed reserved methods from StorageCredentials classes
* Made the isUsePathStyleUris() method in ServiceClient protected
* Removed CloudTableClient constructors taking only URI/StorageUri and throw if credentials passed into constructors are null as tables do not allow anonymous access
* Removed extraneous ServiceClient constructors
* Moved LeaseDuration, LeaseState, and LeaseStatus from the storage package to the blob package
* Made the parse(String) methods in LeaseDuration, LeaseState, and LeaseStatus internal
* RetryContext currentRetryCount and lastRequestResult fields must be accessed with their corresponding getters/setters
* BlockEntry searchMode field must be accessed through its getter/setter
* BlockEntry has an additional constructor taking only block id
* Removed BlobType enum parse() method
* Removed CopyStatus enum parse() method
* Removed CloudQueueMessage setExpirationTime(), setNextVisibleTime() and setPopReceipt() methods
* Removed TableConstants class
* Removed some classes/methods originally marked "Internal Use Only": Credentials.getSigningAccountName(), StorageCredentialsAccountAndKey.setSigningAccountName(), DeserializationHelper class, some BlobProperties setter methods
* Applied MaximumExecutionTime to downloadToByteArray and downloadRangeToByteArray methods
* Removed GeoReplicationStats.getGeoReplicationStatus(String)
* Moved SharedAccessPolicy, Permissions base classes (and serializers/deserializers) from core to storage
* Added container/queue/table constructors taking only URI or StorageUri to enable direct instantiation with a SAS token
* Fixed LeaseState so that it is parsed correctly. Previously, a leased blob returned LeaseState.UNSPECIFIED rather than LeaseState.LEASED
* Fixed the CloudTable(URI) method to correctly handle partition key and row key limits for passed in SAS tokens
* Fixed an issue that allowed whitespace metadata values to be set
* Changed package name from com.microsoft.windowsazure.storage to com.microsoft.azure.storage
* Deprecated AtomPub format for tables
* Added support for secondary location access in Azure Storage Emulator
* Removed unnecessary exceptions specified in the throws clause of method declarations
* Fixed issue with path-style uris and sas credentials

2014.02.19 Version 0.6.0
* Removed OperationContext getCurrentOperationByteCount/setCurrentOperationByteCount and getIntermediateMD5/setIntermediateMD5 methods
* Deprecated OperationContext getCurrentRequestObject/setCurrentReqestObject methods
Expand Down
142 changes: 75 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,125 +1,133 @@
#Windows Azure Storage SDK for Java
#Microsoft Azure Storage SDK for Java

This project provides a client library in Java that makes it easy to consume Windows Azure Storage services. For documentation please see the [Windows Azure Java Developer Center](http://www.windowsazure.com/en-us/develop/java/) and the [JavaDocs](http://dl.windowsazure.com/storage/javadoc).
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://dl.windowsazure.com/storage/javadoc).

#Features
* Blob
* Create/Read/Update/Delete containers
* Create/Read/Update/Delete blobs
* Advanced Blob Operations
* Queue
* Create/Delete Queues
* Insert/Peek Queue Messages
* Advanced Queue Operations
* Table
* Create/Read/Update/Delete tables
* Create/Read/Update/Delete entities
* Batch operation
* Batch operations
* Advanced Table Operations

#Getting Started

##Download
###Option 1: Via Git
###Option 1: Via Maven

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

git clone git://github.com/WindowsAzure/azure-storage-java.git
cd ./azure-storage-java/microsoft-azure-storage
mvn compile

###Option 2: Via Maven

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.
To get the binaries of this library as distributed by Microsoft, ready for use within your project, you can use Maven.

```xml
<dependency>
<groupId>com.microsoft.windowsazure.storage</groupId>
<artifactId>microsoft-windowsazure-storage-sdk</artifactId>
<version>0.6.0</version>
<version>0.7.0</version>
</dependency>
```

###Option 2: Source Via Git

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

git clone git://github.com/Azure/azure-storage-java.git
cd ./azure-storage-java/microsoft-azure-storage
mvn compile

###Option 3: Source Zip

To download a copy of the source code, click "Download ZIP" on the right side of the page or click [here](https://github.com/Azure/azure-storage-java/archive/master.zip). Unzip and navigate to the microsoft-azure-storage folder.

##Minimum Requirements

* Java 1.6
* Java 1.6+
* [Jackson-Core](https://github.com/FasterXML/jackson-core) is used for JSON parsing.
* (Optional) [SLF4J](http://www.slf4j.org/) is a logging facade.
* (Optional) [SLF4J binding](http://www.slf4j.org/manual.html) is used to associate a specific logging framework with SLF4J.
* (Optional) Maven


The two dependencies, [Jackson-Core](https://github.com/FasterXML/jackson-core) and [SLF4J](http://www.slf4j.org/), will be added automatically if Maven is used. Otherwise, please download the jars and add them to your build path.

SLF4J is only needed if you enable logging through the OperationContext class. If you plan to use logging, please also download an [SLF4J binding](http://repo2.maven.org/maven2/org/slf4j/) which will link the SLF4J API with the logging implementation of your choice. Simple is a good default. See the [SLF4J user manual](http://www.slf4j.org/manual.html) for more information.

##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
deployment tools.
To use this SDK to call Microsoft Azure storage services, you need to first [create an account](https://account.windowsazure.com/signup).

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

##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 for [blobs](http://www.windowsazure.com/en-us/develop/java/how-to-guides/blob-storage/), [queues](http://www.windowsazure.com/en-us/develop/java/how-to-guides/queue-service/) and [tables](http://www.windowsazure.com/en-us/develop/java/how-to-guides/table-service/) and the [general documentation](http://www.windowsazure.com/en-us/develop/java/).
The following is a quick example on how to upload a file to azure blob and download it back. You may also download and view the samples in the microsoft-azure-storage-samples folder. For additional information on using the client libraries to access Azure services see the How To guides for [blobs](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-blob-storage/), [queues](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-queue-storage/), [tables](http://azure.microsoft.com/en-us/documentation/articles/storage-java-how-to-use-table-storage/) and the [general documentation](http://azure.microsoft.com/en-us/develop/java/).

```java
import java.io.*;

import com.microsoft.windowsazure.storage.*;
import com.microsoft.windowsazure.storage.blob.*;
import com.microsoft.azure.storage.*;
import com.microsoft.azure.storage.blob.*;

public class BlobSample {
public static final String storageConnectionString =
"DefaultEndpointsProtocol=http;"
+ "AccountName=your_account_name;"
+ "AccountKey= your_account_key";
"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.createIfNotExists();

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

CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);
CloudBlobClient serviceClient = account.createCloudBlobClient();

// Container name must be lower case.
CloudBlobContainer container = serviceClient.getContainerReference("myimages");
container.createIfNotExists();

// Upload an image file.
CloudBlockBlob blob = container.getBlockBlobReference("image1.jpg");
File sourceFile = new File("c:\\myimages\\image1.jpg");
blob.upload(new FileInputStream(sourceFile), sourceFile.length());

// Download the image file.
File destinationFile = new File(sourceFile.getParentFile(), "image1Download.tmp");
blob.downloadToFile(destinationFile.getAbsolutePath());
}
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 MSDN](http://social.msdn.microsoft.com/Forums/windowsazure/en-US/home?forum=windowsazuredata) or the [Developer Forums on Stack Overflow](http://stackoverflow.com/questions/tagged/azure+windows-azure-storage) if you have trouble with the provided code.
Be sure to check out the Microsoft Azure [Developer Forums on MSDN](http://social.msdn.microsoft.com/Forums/windowsazure/en-US/home?forum=windowsazuredata) or the [Developer Forums on Stack Overflow](http://stackoverflow.com/questions/tagged/azure+windows-azure-storage) 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 [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html).

If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/WindowsAzure/azure-storage-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-storage-java/issues) section of the project.

#Learn More

* [Windows Azure Java Developer Center](http://www.windowsazure.com/en-us/develop/java/)
* [Windows Azure Storage Service](http://www.windowsazure.com/en-us/documentation/services/storage/)
* [JavaDocs](http://dl.windowsazure.com/storage/javadoc)
* [Azure Developer Center](http://azure.microsoft.com/en-us/develop/java/)
* [Azure Storage Service](http://azure.microsoft.com/en-us/documentation/services/storage/)
* [Azure Storage Team Blog](http://blogs.msdn.com/b/windowsazurestorage/)
* [JavaDocs](http://dl.windowsazure.com/storage/javadoc)
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
<groupId>windowsazure-storage-samples</groupId>
<artifactId>windowsazure-storage-samples</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>windowsazure-storage-samples</name>

<name>Microsoft Azure Storage Client Samples</name>
<description>Samples for creating blobs, queues and tables</description>
<url>https://github.com/Azure/azure-storage-java</url>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
Expand All @@ -22,7 +25,7 @@
<dependency>
<groupId>com.microsoft.windowsazure.storage</groupId>
<artifactId>microsoft-windowsazure-storage-sdk</artifactId>
<version>0.6.0</version>
<version>0.7.0</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.microsoft.windowsazure.storage.blob.gettingstarted;
package com.microsoft.azure.storage.blob.gettingstarted;

import java.net.URISyntaxException;
import java.security.InvalidKeyException;

import com.microsoft.windowsazure.storage.CloudStorageAccount;
import com.microsoft.windowsazure.storage.blob.BlobContainerPermissions;
import com.microsoft.windowsazure.storage.blob.BlobContainerPublicAccessType;
import com.microsoft.windowsazure.storage.blob.CloudBlobClient;
import com.microsoft.windowsazure.storage.blob.CloudBlobContainer;
import com.microsoft.windowsazure.storage.blob.CloudBlockBlob;
import com.microsoft.windowsazure.storage.blob.ListBlobItem;
import com.microsoft.windowsazure.storage.util.Utility;
import com.microsoft.azure.storage.CloudStorageAccount;
import com.microsoft.azure.storage.blob.BlobContainerPermissions;
import com.microsoft.azure.storage.blob.BlobContainerPublicAccessType;
import com.microsoft.azure.storage.blob.CloudBlobClient;
import com.microsoft.azure.storage.blob.CloudBlobContainer;
import com.microsoft.azure.storage.blob.CloudBlockBlob;
import com.microsoft.azure.storage.blob.ListBlobItem;
import com.microsoft.azure.storage.util.Utility;

/**
* This sample illustrates basic usage of the various Blob Primitives provided
Expand Down
Loading

0 comments on commit e40cf09

Please sign in to comment.