From d387a251132e7d80a9ea07c6c62decb70af7c490 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 14 Aug 2013 17:05:20 -0700 Subject: [PATCH] Enforce a non-negative content length --- .../org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java index 2f0cf19183..2069220abf 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java @@ -178,6 +178,7 @@ public class BlobBuilderImpl implements BlobBuilder { @Override public PayloadBlobBuilder contentLength(long contentLength) { + checkArgument(contentLength >= 0, "content length must be non-negative"); payload.getContentMetadata().setContentLength(contentLength); return this; }