没有容器名称的Azure Blob上载 - Java

时间:2014-03-31 07:32:00

标签: java azure azure-blob-storage

我可以使用以下代码将blob(BlockBlob)上传到容器和子目录:

String storageConnectionString = "UseDevelopmentStorage=true";      
CloudStorageAccount account;
CloudBlobClient serviceClient;
CloudBlobContainer container;
CloudBlockBlob blob;

account = CloudStorageAccount.parse(storageConnectionString);

serviceClient = account.createCloudBlobClient();
container = serviceClient.getContainerReference("sample");
container.createIfNotExist();

blob = container.getBlockBlobReference("myfolder/test/31-Mar/testing/testvideo.wvm");
File fileReference = new File("C:\\myvideo.wvm");
blob.upload(new FileInputStream(fileReference), fileReference.length());

如果我没有容器名称并且只有容器引用,我该如何上传?

由于

0 个答案:

没有答案