public class OAuth extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
OAuth.Parameter
A name/value pair.
|
static class |
OAuth.Problems
Strings used for problem
reporting.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ENCODING
The encoding used to represent characters as bytes.
|
static String |
FORM_ENCODED
The MIME type for a sequence of OAuth parameters.
|
static String |
HMAC_SHA1 |
static String |
HMAC_SHA256 |
static String |
OAUTH_CALLBACK |
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_VERSION |
static String |
RSA_SHA1 |
static String |
VERSION_1_0 |
| Constructor and Description |
|---|
OAuth() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addParameters(String url,
Iterable<? extends Map.Entry<String,String>> parameters) |
static String |
addParameters(String url,
String... parameters)
Construct a URL like the given one, but with the given parameters added
to its query string.
|
static List<OAuth.Parameter> |
decodeForm(String form)
Parse a form-urlencoded document.
|
static String |
decodePercent(String s) |
static String |
formEncode(Iterable<? extends Map.Entry> parameters)
Construct a form-urlencoded document containing the given sequence of
name/value pairs.
|
static void |
formEncode(Iterable<? extends Map.Entry> parameters,
OutputStream into)
Write a form-urlencoded document into the given stream, containing the
given sequence of name/value pairs.
|
static boolean |
isEmpty(String str) |
static boolean |
isFormEncoded(String contentType)
Return true if the given Content-Type header means FORM_ENCODED.
|
static List<OAuth.Parameter> |
newList(String... parameters)
Construct a list of Parameters from name, value, name, value...
|
static Map<String,String> |
newMap(Iterable<? extends Map.Entry> from)
Construct a Map containing a copy of the given parameters.
|
static String |
percentEncode(Iterable<?> values)
Construct a &-separated list of the given values, percentEncoded.
|
static String |
percentEncode(String s) |
public static final String VERSION_1_0
public static final String ENCODING
public static final String FORM_ENCODED
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 HMAC_SHA1
public static final String HMAC_SHA256
public static final String RSA_SHA1
public static boolean isFormEncoded(String contentType)
public static String formEncode(Iterable<? extends Map.Entry> parameters) throws IOException
IOExceptionpublic static void formEncode(Iterable<? extends Map.Entry> parameters, OutputStream into) throws IOException
IOExceptionpublic static List<OAuth.Parameter> decodeForm(String form)
public static String percentEncode(Iterable<?> values)
public static Map<String,String> newMap(Iterable<? extends Map.Entry> from)
public static List<OAuth.Parameter> newList(String... parameters)
public static String addParameters(String url, String... parameters) throws IOException
IOExceptionpublic static String addParameters(String url, Iterable<? extends Map.Entry<String,String>> parameters) throws IOException
IOExceptionpublic static boolean isEmpty(String str)
Copyright 2015- Charles R. Severance and licensed CC-BY Attribution 4.0