|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoauth.signpost.OAuth
public class OAuth
| Field Summary | |
|---|---|
static String |
ENCODING
|
static String |
FORM_ENCODED
|
static String |
HTTP_AUTHORIZATION_HEADER
|
static String |
OAUTH_CALLBACK
|
static String |
OAUTH_CALLBACK_CONFIRMED
|
static String |
OAUTH_CONSUMER_KEY
|
static String |
OAUTH_NONCE
|
static String |
OAUTH_SIGNATURE
|
static String |
OAUTH_SIGNATURE_METHOD
|
static String |
OAUTH_TIMESTAMP
|
static String |
OAUTH_TOKEN
|
static String |
OAUTH_TOKEN_SECRET
|
static String |
OAUTH_VERIFIER
|
static String |
OAUTH_VERSION
|
static String |
OUT_OF_BAND
Pass this value as the callback "url" upon retrieving a request token if your application cannot receive callbacks (e.g. |
static String |
VERSION_1_0
|
| Constructor Summary | |
|---|---|
OAuth()
|
|
| Method Summary | ||
|---|---|---|
static String |
addQueryParameters(String url,
Map<String,String> params)
|
|
static String |
addQueryParameters(String url,
String... kvPairs)
Appends a list of key/value pairs to the given URL, e.g.: |
|
static void |
debugOut(String key,
String value)
|
|
static HttpParameters |
decodeForm(InputStream content)
|
|
static HttpParameters |
decodeForm(String form)
Parse a form-urlencoded document. |
|
static
|
formEncode(Collection<T> parameters)
Construct a x-www-form-urlencoded document containing the given sequence of name/value pairs. |
|
static
|
formEncode(Collection<T> parameters,
OutputStream into)
Construct a x-www-form-urlencoded document containing the given sequence of name/value pairs. |
|
static boolean |
isEmpty(String str)
|
|
static HttpParameters |
oauthHeaderToParamsMap(String oauthHeader)
|
|
static String |
percentDecode(String s)
|
|
static String |
percentEncode(String s)
|
|
static String |
safeToString(Object from)
|
|
static String |
toHeaderElement(String name,
String value)
Helper method to concatenate a parameter and its value to a pair that can be used in an HTTP header. |
|
static
|
toMap(Collection<T> from)
Construct a Map containing a copy of the given parameters. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String VERSION_1_0
public static final String ENCODING
public static final String FORM_ENCODED
public static final String HTTP_AUTHORIZATION_HEADER
public static final String OAUTH_CONSUMER_KEY
public static final String OAUTH_TOKEN
public static final String OAUTH_TOKEN_SECRET
public static final String OAUTH_SIGNATURE_METHOD
public static final String OAUTH_SIGNATURE
public static final String OAUTH_TIMESTAMP
public static final String OAUTH_NONCE
public static final String OAUTH_VERSION
public static final String OAUTH_CALLBACK
public static final String OAUTH_CALLBACK_CONFIRMED
public static final String OAUTH_VERIFIER
public static final String OUT_OF_BAND
OAuthProvider.retrieveAccessToken(OAuthConsumer, String) in order
to complete the token handshake.
| Constructor Detail |
|---|
public OAuth()
| Method Detail |
|---|
public static String percentEncode(String s)
public static String percentDecode(String s)
public static <T extends Map.Entry<String,String>> void formEncode(Collection<T> parameters,
OutputStream into)
throws IOException
IOException
public static <T extends Map.Entry<String,String>> String formEncode(Collection<T> parameters)
throws IOException
IOExceptionpublic static HttpParameters decodeForm(String form)
public static HttpParameters decodeForm(InputStream content)
throws IOException
IOExceptionpublic static <T extends Map.Entry<String,String>> Map<String,String> toMap(Collection<T> from)
public static final String safeToString(Object from)
public static boolean isEmpty(String str)
public static String addQueryParameters(String url,
String... kvPairs)
String url = OAuth.addQueryParameters("http://example.com?a=1", b, 2, c, 3);
which yields:
http://example.com?a=1&b=2&c=3All parameters will be encoded according to OAuth's percent encoding rules.
url - the URLkvPairs - the list of key/value pairs
public static String addQueryParameters(String url,
Map<String,String> params)
public static HttpParameters oauthHeaderToParamsMap(String oauthHeader)
public static String toHeaderElement(String name,
String value)
name - the OAuth parameter name, e.g. oauth_tokenvalue - the OAuth parameter value, e.g. 'hello oauth'
public static void debugOut(String key,
String value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||