当前位置: 首页>>代码示例>>Java>>正文


Java OAuth.percentEncode方法代码示例

本文整理汇总了Java中net.oauth.OAuth.percentEncode方法的典型用法代码示例。如果您正苦于以下问题:Java OAuth.percentEncode方法的具体用法?Java OAuth.percentEncode怎么用?Java OAuth.percentEncode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.oauth.OAuth的用法示例。


在下文中一共展示了OAuth.percentEncode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBaseString

import net.oauth.OAuth; //导入方法依赖的package包/类
public static String getBaseString(OAuthMessage message)
        throws IOException, URISyntaxException {
    List<Map.Entry<String, String>> parameters;
    String url = message.URL;
    int q = url.indexOf('?');
    if (q < 0) {
        parameters = message.getParameters();
    } else {
        // Combine the URL query string with the other parameters:
        parameters = new ArrayList<Map.Entry<String, String>>();
        parameters.addAll(OAuth.decodeForm(message.URL.substring(q + 1)));
        parameters.addAll(message.getParameters());
        url = url.substring(0, q);
    }
    return OAuth.percentEncode(message.method.toUpperCase()) + '&'
            + OAuth.percentEncode(normalizeUrl(url)) + '&'
            + OAuth.percentEncode(normalizeParameters(parameters));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:OAuthSignatureMethod.java

示例2: computeSignature

import net.oauth.OAuth; //导入方法依赖的package包/类
private byte[] computeSignature(String baseString)
        throws GeneralSecurityException, UnsupportedEncodingException {
    SecretKey key = null;
    synchronized (this) {
        if (this.key == null) {
            String keyString = OAuth.percentEncode(getConsumerSecret())
                    + '&' + OAuth.percentEncode(getTokenSecret());
            byte[] keyBytes = keyString.getBytes(ENCODING);
            this.key = new SecretKeySpec(keyBytes, MAC_NAME);
        }
        key = this.key;
    }
    Mac mac = Mac.getInstance(MAC_NAME);
    mac.init(key);
    byte[] text = baseString.getBytes(ENCODING);
    return mac.doFinal(text);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:HMAC_SHA1.java

示例3: ComparableParameter

import net.oauth.OAuth; //导入方法依赖的package包/类
ComparableParameter(Map.Entry value) {
    this.value = value;
    String n = toString(value.getKey());
    String v = toString(value.getValue());
    this.key = OAuth.percentEncode(n) + ' ' + OAuth.percentEncode(v);
    // ' ' is used because it comes before any character
    // that can appear in a percentEncoded string.
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:OAuthSignatureMethod.java

示例4: getSignature

import net.oauth.OAuth; //导入方法依赖的package包/类
private synchronized String getSignature() {
    if (signature == null) {
        signature = OAuth.percentEncode(getConsumerSecret()) + '&'
                + OAuth.percentEncode(getTokenSecret());
    }
    return signature;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:PLAINTEXT.java

示例5: ComparableParameter

import net.oauth.OAuth; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
ComparableParameter(Map.Entry value) {
          this.value = value;
          String n = toString(value.getKey());
          String v = toString(value.getValue());
          this.key = OAuth.percentEncode(n) + ' ' + OAuth.percentEncode(v);
          // ' ' is used because it comes before any character
          // that can appear in a percentEncoded string.
      }
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:10,代码来源:OAuthSignatureMethod.java


注:本文中的net.oauth.OAuth.percentEncode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。