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 |
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 |
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 String |
decodeCharacters(byte[] from) |
static List<OAuth.Parameter> |
decodeForm(String form)
Parse a form-urlencoded document.
|
static String |
decodePercent(String s) |
static byte[] |
encodeCharacters(String from) |
static String |
formEncode(Iterable<? extends Map.Entry<String,String>> parameters)
Construct a form-urlencoded document containing the given sequence of
name/value pairs.
|
static void |
formEncode(Iterable<? extends Map.Entry<String,String>> 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<String,String>> from)
Construct a MapService containing a copy of the given parameters.
|
static String |
percentEncode(Iterable<String> values)
Construct a &-separated list of the given values, percentEncoded.
|
static String |
percentEncode(String s) |
static void |
setCharacterEncoding(String encoding) |
public static final String ENCODING
public static final String FORM_ENCODED
public static final String HMAC_SHA1
public static final String OAUTH_CALLBACK
public static final String OAUTH_CALLBACK_CONFIRMED
public static final String OAUTH_CONSUMER_KEY
public static final String OAUTH_NONCE
public static final String OAUTH_SIGNATURE
public static final String OAUTH_SIGNATURE_METHOD
public static final String OAUTH_TIMESTAMP
public static final String OAUTH_TOKEN
public static final String OAUTH_TOKEN_SECRET
public static final String OAUTH_VERIFIER
public static final String OAUTH_VERSION
public static final String RSA_SHA1
public static final String VERSION_1_0
public static String addParameters(String url, Iterable<? extends Map.Entry<String,String>> parameters) throws IOException
IOException
public static String addParameters(String url, String... parameters) throws IOException
IOException
public static String decodeCharacters(byte[] from)
public static List<OAuth.Parameter> decodeForm(String form)
public static byte[] encodeCharacters(String from)
public static String formEncode(Iterable<? extends Map.Entry<String,String>> parameters) throws IOException
IOException
public static void formEncode(Iterable<? extends Map.Entry<String,String>> parameters, OutputStream into) throws IOException
IOException
public static boolean isEmpty(String str)
public static boolean isFormEncoded(String contentType)
public static List<OAuth.Parameter> newList(String... parameters)
public static Map<String,String> newMap(Iterable<? extends Map.Entry<String,String>> from)
public static String percentEncode(Iterable<String> values)
public static void setCharacterEncoding(String encoding)
Copyright © 2008–2017 Province of British Columbia. All rights reserved.