JCLOUDS-912: GCS upload InputStream work around

This commit is contained in:
Andrew Gaul 2016-06-03 12:38:43 -07:00
parent 5d437312bf
commit c2a22bc32c
1 changed files with 3 additions and 1 deletions

View File

@ -214,7 +214,9 @@ public final class GoogleCloudStorageBlobStore extends BaseBlobStore {
@Override
public String putBlob(String container, Blob blob, PutOptions options) {
if (options.isMultipart()) {
if (options.isMultipart() || !blob.getPayload().isRepeatable()) {
// JCLOUDS-912 prevents using single-part uploads with InputStream payloads.
// Work around this with multi-part upload which buffers parts in-memory.
return putMultipartBlob(container, blob, options);
} else {
checkNotNull(blob.getPayload().getContentMetadata().getContentLength());