本文整理了Java中net.oauth.OAuth.toString()
方法的一些代码示例,展示了OAuth.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OAuth.toString()
方法的具体详情如下:
包路径:net.oauth.OAuth
类名称:OAuth
方法名:toString
暂无
代码示例来源:origin: net.oauth.core/oauth
/**
* Construct a Map containing a copy of the given parameters. If several
* parameters have the same name, the Map will contain the first value,
* only.
*/
public static Map<String, String> newMap(Iterable<? extends Map.Entry> from) {
Map<String, String> map = new HashMap<String, String>();
if (from != null) {
for (Map.Entry f : from) {
String key = toString(f.getKey());
if (!map.containsKey(key)) {
map.put(key, toString(f.getValue()));
}
}
}
return map;
}
代码示例来源:origin: sakaiproject/sakai
/**
* Construct a Map containing a copy of the given parameters. If several
* parameters have the same name, the Map will contain the first value,
* only.
*/
@SuppressWarnings("rawtypes")
public static Map<String, String> newMap(Iterable<? extends Map.Entry> from) {
Map<String, String> map = new HashMap<String, String>();
if (from != null) {
for (Map.Entry f : from) {
String key = toString(f.getKey());
if (!map.containsKey(key)) {
map.put(key, toString(f.getValue()));
}
}
}
return map;
}
代码示例来源:origin: sakaiproject/sakai
/** Construct a &-separated list of the given values, percentEncoded. */
public static String percentEncode(Iterable<?> values) {
StringBuilder p = new StringBuilder();
for (Object v : values) {
if (p.length() > 0) {
p.append("&");
}
p.append(OAuth.percentEncode(toString(v)));
}
return p.toString();
}
代码示例来源:origin: net.oauth.core/oauth
/** Construct a &-separated list of the given values, percentEncoded. */
public static String percentEncode(Iterable values) {
StringBuilder p = new StringBuilder();
for (Object v : values) {
if (p.length() > 0) {
p.append("&");
}
p.append(OAuth.percentEncode(toString(v)));
}
return p.toString();
}
代码示例来源:origin: sakaiproject/sakai
/**
* Write a form-urlencoded document into the given stream, containing the
* given sequence of name/value pairs.
*/
@SuppressWarnings("rawtypes")
public static void formEncode(Iterable<? extends Map.Entry> parameters,
OutputStream into) throws IOException {
if (parameters != null) {
boolean first = true;
for (Map.Entry parameter : parameters) {
if (first) {
first = false;
} else {
into.write('&');
}
into.write(percentEncode(toString(parameter.getKey()))
.getBytes());
into.write('=');
into.write(percentEncode(toString(parameter.getValue()))
.getBytes());
}
}
}
代码示例来源:origin: net.oauth.core/oauth
/**
* Write a form-urlencoded document into the given stream, containing the
* given sequence of name/value pairs.
*/
public static void formEncode(Iterable<? extends Map.Entry> parameters,
OutputStream into) throws IOException {
if (parameters != null) {
boolean first = true;
for (Map.Entry parameter : parameters) {
if (first) {
first = false;
} else {
into.write('&');
}
into.write(encodeCharacters(percentEncode(toString(parameter.getKey()))));
into.write('=');
into.write(encodeCharacters(percentEncode(toString(parameter.getValue()))));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!