mirror of https://github.com/apache/jclouds.git
Handle multiple of MAX_BLOCK_SIZE for Azure MPU
Currently files are not properly uploaded if they are a multiple of MAX_BLOCK_SIZE. Fixes JCLOUDS-233.
This commit is contained in:
parent
96c326d0cd
commit
19f79145fc
|
@ -70,7 +70,7 @@ public class AzureBlobBlockUploadStrategy implements MultipartUploadStrategy {
|
||||||
while (offset < length) {
|
while (offset < length) {
|
||||||
blockCount++;
|
blockCount++;
|
||||||
long chunkSize = MAX_BLOCK_SIZE;
|
long chunkSize = MAX_BLOCK_SIZE;
|
||||||
if (blockCount >= totalBlocks) {
|
if (length - offset < MAX_BLOCK_SIZE) {
|
||||||
chunkSize = length % MAX_BLOCK_SIZE;
|
chunkSize = length % MAX_BLOCK_SIZE;
|
||||||
}
|
}
|
||||||
bytesWritten += chunkSize;
|
bytesWritten += chunkSize;
|
||||||
|
|
Loading…
Reference in New Issue