diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java index 97d4553433..eed9ab124b 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java @@ -360,7 +360,7 @@ public abstract class BaseBlobStore implements BlobStore { long partSize = algorithm.calculateChunkSize(contentLength); int partNumber = 1; // TODO: for InputStream payloads, this buffers all parts in-memory! - while (partNumber < algorithm.getParts()) { + while (partNumber <= algorithm.getParts()) { Payload payload = slicer.slice(blob.getPayload(), algorithm.getCopied(), partSize); BlobUploader b = new BlobUploader(mpu, partNumber++, payload); diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java index af713fe629..023c870b64 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java @@ -828,6 +828,8 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { assertThat(etag).isNotNull(); Blob blob = blobStore.getBlob(container, blobName); + assertThat(blob.getMetadata().getContentMetadata().getContentLength()).isEqualTo(length); + InputStream is = null; try { is = blob.getPayload().openStream();