You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Andrew Gaul (JIRA)" <ji...@apache.org> on 2019/01/16 00:00:00 UTC
[jira] [Updated] (JCLOUDS-1487) Blob content length is mandatory
while uploading to Azure
[ https://issues.apache.org/jira/browse/JCLOUDS-1487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Gaul updated JCLOUDS-1487:
---------------------------------
Labels: azureblob (was: )
> Blob content length is mandatory while uploading to Azure
> ---------------------------------------------------------
>
> Key: JCLOUDS-1487
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1487
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-blobstore
> Affects Versions: 2.1.1
> Reporter: Alexander Chernavin
> Priority: Major
> Labels: azureblob
> Attachments: length_exception.txt
>
>
> Content length is mandatory while uploading to Azure using JClouds portable Blob Store API
>
> Code example:
> Blob blob = blobStore.blobBuilder(blobName)
> .payload(new InputStreamPayload(inputStream))
> .contentType(contentType)
> .build();
> blobStore.putBlob(container, blob);
>
> [BindAzureBlobMetadataToRequest|https://github.com/fusesource/jclouds/blame/master/providers/azureblob/src/main/java/org/jclouds/azureblob/binders/BindAzureBlobMetadataToRequest.java] class checks that content length is specified and is greater than zero in lines 58-59. However, according to the Azure SDK documentation, Azure [CloudBlockBlob|https://azure.github.io/azure-sdk-for-java/com/microsoft/azure/storage/blob/CloudBlockBlob.html#upload-java.io.InputStream-long-] also accepts -1 if content length is unknown:
> {{length}} - A {{long}} which represents the length, in bytes, of the stream data, or -1 if unknown.
>
> We have a use case when we need to stream a big chunk of data of unknown size directly into a cloud storage. Portable JClouds API allows to upload files into OpenStack SWIFT without specifying their size, but it fails on Azure.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)