> +
> + public static ContentRange fromPartNumber(long partNumber, long
> partSizeInMB) {
> + if (partNumber < 0)
> + throw exception("The part number cannot be negative");
> + if (partSizeInMB < 1)
> + throw exception("The part size has to be possitive");
> + long from = partNumber * (partSizeInMB << 20);
> + long to = from + (partSizeInMB << 20) - 1;
> + return new ContentRange(from, to);
> + }
> +
> + public static ContentRange build(long from, long to) {
> + return new ContentRange(from, to);
> + }
> +
> + protected static IllegalArgumentException exception(String reason) {
Does this helper give us some advantage? Otherwise can we use
`Preconditions.checkArgument` instead? It supports custom formatting with its
vararg method.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/18/files#r13990291