private int parseQueryParams(final String path, int i) {
    if (i >= path.length()) {
      return i;
    }
    StringBuilder query = new StringBuilder();
    try {
      query.append(URLDecoder.decode(path.substring(i), HConstants.UTF8_ENCODING));
    } catch (UnsupportedEncodingException e) {
      // should not happen
      throw new RuntimeException(e);
    }
    i += query.length();
    int j = 0;
    while (j < query.length()) {
      char c = query.charAt(j);
      if (c != '?' && c != '&') {
        break;
      }
      if (++j > query.length()) {
        throw new IllegalArgumentException("malformed query parameter");
      }
      char what = query.charAt(j);
      if (++j > query.length()) {
        break;
      }
      c = query.charAt(j);
      if (c != '=') {
        throw new IllegalArgumentException("malformed query parameter");
      }
      if (++j > query.length()) {
        break;
      }
      switch (what) {
        case 'm': {
          StringBuilder sb = new StringBuilder();
          while (j <= query.length()) {
            c = query.charAt(j);
            if (c < '0' || c > '9') {
              j--;
              break;
            }
            sb.append(c);
          }
          maxVersions = Integer.parseInt(sb.toString());
        }
          break;
        case 'n': {
          StringBuilder sb = new StringBuilder();
          while (j <= query.length()) {
            c = query.charAt(j);
            if (c < '0' || c > '9') {
              j--;
              break;
            }
            sb.append(c);
          }
          maxValues = Integer.parseInt(sb.toString());
        }
          break;
        default:
          throw new IllegalArgumentException("unknown parameter '" + c + "'");
      }
    }
    return i;
  }
Parses a path based row/column/timestamp specification into its component elements.
<p>
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowSpec.java