> +
> + public static final class Builder {
> + public static ContentRange fromString(String contentRangeString) {
> + if (isNullOrEmpty(contentRangeString) ||
> !contentRangeString.matches("[0-9]+-[0-9]+"))
> + throw exception("The string should be two numbers separated by a
> hyphen (from-to)");
> + String[] strings = contentRangeString.split("-", 2);
> + long from = Long.parseLong(strings[0]);
> + long to = Long.parseLong(strings[1]);
> + return new ContentRange(from, to);
> + }
> +
> + 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");
spelling: positive
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/18/files#r13990129