code: public static boolean parseRanges(FileRequestContext context) {
      if( !StringUtils.isBlank(context.range) ) {
        Matcher rangeMatcher = rangePattern.matcher(context.range);
        if(rangeMatcher.matches()) {
          String ranges[] = rangeMatcher.group(1).split(",");
          for(String range : ranges) {
            long startBound = -1;
            int hyphenIndex = range.indexOf('-');
            if( hyphenIndex > 0 ) {
              startBound = Long.parseLong(range.substring(0, hyphenIndex));
            }
            long endBound = -1;
            if( hyphenIndex >= 0 && (hyphenIndex + 1) < range.length() ) {
              endBound = Long.parseLong(range.substring(hyphenIndex + 1));
            }
            Range newRange = new Range(startBound, endBound);
            
            if(!(startBound != -1 && endBound != -1 && startBound > endBound) && !(startBound == -1 && endBound == -1)) {
              context.ranges.add(newRange);
            }
          } 
          return !context.ranges.isEmpty();
        }
      }
      return true;
    }
docs: Parses the Range Header of the request and sets the appropriate ranges list on the {@link FileRequestContext} Object.
  
  @param context
  @return false if the range pattern contains no satisfiable ranges.