public String normalizeRequestParameters() {
    if (requestParameters == null) {
      return "";
    }
    StringBuilder stringbuilder = new StringBuilder();
    Iterator iterator = requestParameters.keySet().iterator();
    for (int i = 0; iterator.hasNext(); i++) {
      String s = (String) iterator.next();
      if ("oauth_signature".equals(s) || "realm".equals(s)) {
        continue;
      }
      if (i > 0) {
        stringbuilder.append("&");
      }
      stringbuilder.append(requestParameters.getAsQueryString(s));
    }

    return stringbuilder.toString();
  }
Пример #2
0
  /**
   * Normalizes the set of request parameters this instance was configured with, as per OAuth spec
   * section 9.1.1.
   *
   * @param parameters the set of request parameters
   * @return the normalized params string
   * @throws IOException
   */
  public String normalizeRequestParameters() throws IOException {
    if (requestParameters == null) {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    Iterator<String> iter = requestParameters.keySet().iterator();

    for (int i = 0; iter.hasNext(); i++) {
      String param = iter.next();

      if (OAuth.OAUTH_SIGNATURE.equals(param) || "realm".equals(param)) {
        continue;
      }

      if (i > 0) {
        sb.append("&");
      }

      sb.append(requestParameters.getAsQueryString(param));
    }
    return sb.toString();
  }