Tag: Azure的存储

如何在Document DB java SDK中指定删除文档的NONE分区键?

我只有一个集合,当我尝试使用下面的代码删除文档时 PartitionKey partitionKey = new PartitionKey(“undefined”); RequestOptions requestOptions=new RequestOptions(); requestOptions.setPartitionKey(partitionKey); for(Document currentDocument: existingIMEIDevice){ try { ConfigVariables.documentClient.deleteDocument(currentDocument.getSelfLink(), requestOptions); } catch (DocumentClientException e) { // TODO Auto-generated catch block e.printStackTrace(); } 它抛出exception。 com.microsoft.azure.documentdb.DocumentClientException:消息:{“错误”:[“未找到资源”]} ActivityId:4353e7c0-0b24-4b2a-8ec6-fc2db4059aa0,请求URI:/ apps / 708ed403-166f-44e4-847f -ccaa0cd22d9c / services / d1e2ed4d-7e69-4a3d-9575-3e24b96621b4 / partitions / e3fc6138-06a5-4876-a629-a4be69917ded / replicas / 131533416718986721p,StatusCode:NotFound at com.microsoft.azure.documentdb.internal.ErrorUtils.maybeThrowException(ErrorUtils .java:69)com.microsoft.azure.documentdb.internal.GatewayProxy.performDeleteRequest(GatewayProxy.java:187)at com.microsoft.azure.documentdb.internal.GatewayProxy.doDelete(GatewayProxy.java:99)at com。 micros.aure.documentdb.internal.GatewayProxy.processMessage(GatewayProxy.java:332)at com.microsoft.azure.documentdb.DocumentClient […]

来自android示例的Azure存储块blob上传

我使用Android应用程序中的以下代码将blob上传到Azure Blob存储。 注意:下面的sasUrl参数是从我的Web服务获取的签名URL: // upload file to azure blob storage private static Boolean upload(String sasUrl, String filePath, String mimeType) { try { // Get the file data File file = new File(filePath); if (!file.exists()) { return false; } String absoluteFilePath = file.getAbsolutePath(); FileInputStream fis = new FileInputStream(absoluteFilePath); int bytesRead = 0; ByteArrayOutputStream bos = new […]

java azure storage error“枚举结果”

我正在使用以下代码消耗android azure存储API: try { // Retrieve storage account from connection-string. CloudStorageAccount storageAccount = CloudStorageAccount.parse(storageConnectionString); // Create the blob client. CloudBlobClient blobClient = storageAccount.createCloudBlobClient(); // Retrieve reference to a previously created container. CloudBlobContainer container = blobClient.getContainerReference(“appstar”); // Loop over blobs within the container and output the URI to each of them. for (ListBlobItem blobItem : container.listBlobs()) […]

我是否可以将流上传到Azure blob存储而不预先指定其长度?

我不知道它是否相关,但我使用Java与azure-storage-android-0.2.0.aar进行上传。 我可以将文件上传到Microsoft Azure blob存储 CloudBlockBlob blob = container.getBlockBlobReference(“filename.ext”); blob.upload(inputStream, n); 其中n是inputStream从文件派生时的长度。 这是我的问题:我想直接流式传输,例如来自相机,这显然是不可能的,因为Azure需要上传的长度参数,这在流式传输时是未知的。 我需要指定长度吗? (MD5?)还有一种方法可以在流仍在生成时上传(这显然是Java中的InputStream的想法,InputStream没有长度属性的原因)?