无容器名称的Azure Blob上载-Java

无容器名称的Azure Blob上载-Java,java,azure,azure-blob-storage,Java,Azure,Azure Blob Storage,我可以使用以下代码将blob(BlockBlob)上载到容器和子目录: String storageConnectionString = "UseDevelopmentStorage=true"; CloudStorageAccount account; CloudBlobClient serviceClient; CloudBlobContainer container; CloudBlockBlob blob; account = CloudStorageAccount.par

我可以使用以下代码将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());
如果我没有容器名称而只有容器引用,如何上载


谢谢

你说的
我只有集装箱参考号是什么意思。
?由于blob总是上载到容器中,因此您需要以某种方式访问该容器。我的意思是容器名称不可用,但必须上载blob的路径可用请给出一个示例。例如,我有一个文件myvideo.wvm,需要将其上载到“myfolder/test/31 Mar/testing/testvideo.wvm”azure blob存储中的路径。blob始终上载到容器中。在您的情况下,
myfolder
将是在上传blob之前必须存在的容器。