Exemplo n.º 1
0
  /**
   * Builds the signature base string from the data this instance was configured with.
   *
   * @return the signature base string
   * @throws OAuthMessageSignerException
   */
  public String generate() throws OAuthMessageSignerException {

    try {
      String normalizedUrl = normalizeRequestUrl();
      String normalizedParams = normalizeRequestParameters();

      String erm =
          request.getMethod()
              + '&'
              + OAuth.percentEncode(normalizedUrl)
              + '&'
              + OAuth.percentEncode(normalizedParams);
      return erm;
    } catch (Exception e) {
      throw new OAuthMessageSignerException(e);
    }
  }
 public String generate() {
   String s;
   try {
     s = normalizeRequestUrl();
     String s1 = normalizeRequestParameters();
     s =
         (new StringBuilder())
             .append(request.getMethod())
             .append('&')
             .append(OAuth.percentEncode(s))
             .append('&')
             .append(OAuth.percentEncode(s1))
             .toString();
   } catch (Exception exception) {
     throw new OAuthMessageSignerException(exception);
   }
   return s;
 }