本文整理了Java中net.oauth.OAuth.decodePercent()
方法的一些代码示例,展示了OAuth.decodePercent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OAuth.decodePercent()
方法的具体详情如下:
包路径:net.oauth.OAuth
类名称:OAuth
方法名:decodePercent
暂无
代码示例来源:origin: sakaiproject/sakai
/** Parse a form-urlencoded document. */
public static List<Parameter> decodeForm(String form) {
List<Parameter> list = new ArrayList<Parameter>();
if (!isEmpty(form)) {
for (String nvp : form.split("\\&")) {
int equals = nvp.indexOf('=');
String name;
String value;
if (equals < 0) {
name = decodePercent(nvp);
value = null;
} else {
name = decodePercent(nvp.substring(0, equals));
value = decodePercent(nvp.substring(equals + 1));
}
list.add(new Parameter(name, value));
}
}
return list;
}
代码示例来源:origin: net.oauth.core/oauth
/** Parse a form-urlencoded document. */
public static List<Parameter> decodeForm(String form) {
List<Parameter> list = new ArrayList<Parameter>();
if (!isEmpty(form)) {
for (String nvp : form.split("\\&")) {
int equals = nvp.indexOf('=');
String name;
String value;
if (equals < 0) {
name = decodePercent(nvp);
value = null;
} else {
name = decodePercent(nvp.substring(0, equals));
value = decodePercent(nvp.substring(equals + 1));
}
list.add(new Parameter(name, value));
}
}
return list;
}
代码示例来源:origin: sakaiproject/sakai
/**
* Parse the parameters from an OAuth Authorization or WWW-Authenticate
* header. The realm is included as a parameter. If the given header doesn't
* start with "OAuth ", return an empty list.
*/
public static List<OAuth.Parameter> decodeAuthorization(String authorization) {
List<OAuth.Parameter> into = new ArrayList<OAuth.Parameter>();
if (authorization != null) {
Matcher m = AUTHORIZATION.matcher(authorization);
if (m.matches()) {
if (AUTH_SCHEME.equalsIgnoreCase(m.group(1))) {
for (String nvp : m.group(2).split("\\s*,\\s*")) {
m = NVP.matcher(nvp);
if (m.matches()) {
String name = OAuth.decodePercent(m.group(1));
String value = OAuth.decodePercent(m.group(2));
into.add(new OAuth.Parameter(name, value));
}
}
}
}
}
return into;
}
代码示例来源:origin: net.oauth.core/oauth
/**
* Parse the parameters from an OAuth Authorization or WWW-Authenticate
* header. The realm is included as a parameter. If the given header doesn't
* start with "OAuth ", return an empty list.
*/
public static List<OAuth.Parameter> decodeAuthorization(String authorization) {
List<OAuth.Parameter> into = new ArrayList<OAuth.Parameter>();
if (authorization != null) {
Matcher m = AUTHORIZATION.matcher(authorization);
if (m.matches()) {
if (AUTH_SCHEME.equalsIgnoreCase(m.group(1))) {
for (String nvp : m.group(2).split("\\s*,\\s*")) {
m = NVP.matcher(nvp);
if (m.matches()) {
String name = OAuth.decodePercent(m.group(1));
String value = OAuth.decodePercent(m.group(2));
into.add(new OAuth.Parameter(name, value));
}
}
}
}
}
return into;
}
代码示例来源:origin: org.gatein.shindig/shindig-common
m = NVP.matcher(nvp);
if (m.matches() && "token".equals(m.group(1))) {
token = OAuth.decodePercent(m.group(2));
代码示例来源:origin: com.lmco.shindig/shindig-common
m = NVP.matcher(nvp);
if (m.matches() && "token".equals(m.group(1))) {
token = OAuth.decodePercent(m.group(2));
代码示例来源:origin: edu.uiuc.ncsa.security.delegation/ncsa-security-oauth-1.0a
@Override
public CallbackResponse processCallback(CallbackRequest callbackRequest) {
CallbackResponse cResp = new CallbackResponse();
ServletRequest servletRequest = callbackRequest.getServletRequest();
String token = servletRequest.getParameter(OAUTH_TOKEN);
if (token == null || token.length() == 0) {
throw new GeneralException("Error: No token found");
}
String tc = OAuth.decodePercent(token);
String verifier = servletRequest.getParameter(OAUTH_VERIFIER);
if (verifier == null || verifier.length() == 0) {
throw new GeneralException("Error: No verifier found");
}
String v = OAuth.decodePercent(verifier);
AuthorizationGrant ag = tokenForge.getAuthorizationGrant(tc);
cResp.setAuthorizationGrant(ag);
cResp.setVerifier(tokenForge.getVerifier(v));
return cResp;
}
代码示例来源:origin: apache/incubator-wave
OAuthMessage message = new HttpRequestMessage(req, req.getRequestURL().toString());
String username = OAuth.decodePercent(message.getConsumerKey());
内容来源于网络,如有侵权,请联系作者删除!