JCLOUDS-894: Handle part size when > maximum

Azure has a small part size that was not handled by the existing
logic.  This code is twisty and confusing and should be rewritten!
This commit is contained in:
Andrew Gaul 2015-07-09 18:00:37 -07:00
parent 65b7bdf282
commit 7d7deefb75

View File

@ -93,6 +93,11 @@ public final class MultipartUploadSlicingAlgorithm {
parts = (int)(length / partSize); parts = (int)(length / partSize);
} }
} }
if (partSize > maximumPartSize) {
partSize = maximumPartSize;
unitPartSize = maximumPartSize;
parts = (int)(length / unitPartSize);
}
if (parts > maximumNumberOfParts) { // if splits in too many parts or if (parts > maximumNumberOfParts) { // if splits in too many parts or
// cannot be split // cannot be split
unitPartSize = minimumPartSize; // take the minimum part size unitPartSize = minimumPartSize; // take the minimum part size