note

 

http://jersey.java.net/nonav/documentation/latest/user-guide.html

http://www.vogella.de/articles/JAXB/article.html

http://www.vogella.de/articles/REST/article.html

http://msdn.microsoft.com/en-us/library/gg278338.aspx

http://blogs.msdn.com/b/windowsazure/archive/2011/05/18/using-the-service-bus-via-rest-http.aspx

 

 

 

 

https://github.com/WindowsAzure/azure-sdk-for-java

http://go.microsoft.com/fwlink/?LinkID=236226

http://msdn.microsoft.com/en-us/library/windowsazure/hh690943(v=VS.103).aspx

http://msdn.microsoft.com/en-us/library/windowsazure/hh691732(VS.103).aspx

http://msdn.microsoft.com/en-us/library/windowsazure/hh691733(VS.103).aspx

 

 

 

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

        }

 

    }

}



soyatecinterop@live.com
http://ec2-46-137-124-143.eu-west-1.compute.amazonaws.com/svn/microsoft
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值