mirror of https://github.com/apache/jclouds.git
Enforce a non-negative content length
This commit is contained in:
parent
1a003ee731
commit
d387a25113
|
@ -178,6 +178,7 @@ public class BlobBuilderImpl implements BlobBuilder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PayloadBlobBuilder contentLength(long contentLength) {
|
public PayloadBlobBuilder contentLength(long contentLength) {
|
||||||
|
checkArgument(contentLength >= 0, "content length must be non-negative");
|
||||||
payload.getContentMetadata().setContentLength(contentLength);
|
payload.getContentMetadata().setContentLength(contentLength);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue