We have released a storage client Java version that supports Windows http://www.aliyun.com/zixun/aggregation/13357.html ">azure blobs, queue, and table." Our goal is to continue to improve the development experience when writing cloud computing applications that use Windows Azure storage. This is the release of Microsoft's supported Community Technology Preview (CTP). So we combine the customer and the current. NET class Library forum to help us create a more seamless, powerful and Easy-to-use application interface (API). This article provides an overview of this library and includes implementation details that help you understand when developing Java cloud computing applications. In addition, we provide two additional articles covering some of the features and programming models of BLOB and table services.
Package
The storage client Java version is distributed with the Windows Azure SDK Java version of the jar bundle (located below). For the best development experience, you can import the client's child packages directly (com.microsoft.windowsazure.services. [Blob|queue|table].client). This article discusses the client side of this layer.
The related packages can be divided according to the service:
Public package
com.microsoft.windowsazure.services.core.storage– This package contains all the basic elements of storage, such as storage accounts (Cloudstorageaccount), Storage credentials (storagecrendentials), retry policy, and so on.
Service Packs
com.microsoft.windowsazure.services.blob.client– This package contains all the features for the Windows Azure BLOB service, such as BLOB client (cloudblobclient), BLOBs (Cloudblob), and so on.
com.microsoft.windowsazure.services.blob.client– This package contains all of the features for the Windows Azure Queue service, such as the queue client (cloudqueueclient) , Queue (Cloudqueue) and so on.
com.microsoft.windowsazure.services.table.client– This package contains all the features for the Windows Azure table service. such as table client (cloudtableclient), Queue (tableserviceentity), and so on.
Service
Although this article describes the basic concepts of the above packages, it is worth summarizing the capabilities of each client library. The interesting features of blobs and table are worth further discussion. To this end, we have written some other articles, with links below. The Client API interface is designed to be easy to use and easy to understand, and in order to accommodate more complex scenarios, we provide an optional extension point where necessary.
Blob
The BLOB API interface supports all basic operations (upload, download, snapshot, set/read metadata and column directories), as well as basic container operations (create, delete, and list blobs). But we go further and offer some additional convenience features such as recovery downloads, sparse page blob support, simplified MD5 scenarios, and simplified access conditions.
To better explain these features of the BLOB API, we have published another article that is discussed in detail.
Example – uploading files to a block Blob
Import the necessary packages imports Com.microsoft.windowsazure.services.blob.client.cloudblobclient;import Com.microsoft.windowsazure.services.blob.client.cloudblobcontainer;import Com.microsoft.windowsazure.services.blob.client.cloudblockblob;import Com.microsoft.windowsazure.services.core.storage.CloudStorageAccount; Initialize account Cloudstorageaccount = Cloudstorageaccount.parse ([account_string]); Create BLOB client Cloudblobclient blobclient = Account.createcloudblobclient (); Gets the reference to the newly created container cloudblobcontainer container = blobclient.getcontainerreference ("MyContainer"); Create or overwrite a blobcloudblockblob blob named myimage.jpg = Container.getblockblobreference ("Myimage.jpg") with a local file; File Source = new file ("C:\\myimages\\myimage.jpg"); Blob.upload (new FileInputStream (source), Source.length ());
(Note: It is best to always provide the length of the uploaded data if you can.) If the length is unknown, it can also be specified as-1)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.