public class OAuthUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
encode(String stringToEncode)
Formats the input string for inclusion in a url.
|
static String |
getNonce()
Get a nonce for an OAuth request.
|
static String |
getSignatureBaseString(String requestUrl,
String httpMethod,
Map<String,String> baseParameters)
Calculates the signature base url as per section 9.1 of the OAuth Spec.
|
static String |
getTimestamp()
Get a timestamp for an OAuth request.
|
static String |
normalizeParameters(String requestUrl,
Map<String,String> requestParameters)
Calculates the normalized request parameters string to use in the base
string, as per section 9.1.1 of the OAuth Spec.
|
static String |
normalizeUrl(String requestUrl)
Calculates the normalized request url, as per section 9.1.2 of the OAuth
Spec.
|
static Map<String,String> |
parseQuerystring(String queryString)
Parse a querystring into a map of key/value pairs.
|
public static String getNonce()
public static String getTimestamp()
public static String getSignatureBaseString(String requestUrl, String httpMethod, Map<String,String> baseParameters) throws OAuthException
requestUrl - the url of the requesthttpMethod - the http method, for example "GET" or "PUT"baseParameters - the request parameters (see section 9.1.3)OAuthException - if the input url is not formatted properlypublic static String normalizeUrl(String requestUrl) throws OAuthException
requestUrl - the request url to normalize (not null)OAuthException - if the input url is not formatted properlypublic static String normalizeParameters(String requestUrl, Map<String,String> requestParameters)
requestUrl - the request url to normalize (not null)requestParameters - key/value pairs of parameters in the requestpublic static Map<String,String> parseQuerystring(String queryString)
queryString - the string to parse (without the '?')Copyright © 2012. All Rights Reserved.