public final class Https
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HEADER_ELEMENT_FORMAT
header element format.
|
static java.lang.String |
QUERY_STRING_ELEMENT_FORMAT
query string element format.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
format(java.lang.String template,
java.lang.Object... args)
Substitutes each
%s in template with an argument. |
static boolean |
isUsingNonDefaultPort(java.net.URI uri)
Returns
true if the specified URI is using a non-standard port. |
static java.lang.String |
pathEncode(java.lang.String resourcePath) |
static java.lang.String |
percentEncode(java.util.Iterator<?> iterator)
Encodes the iterator as percent encode.
|
static java.lang.String |
toHeaderElement(java.lang.String name,
java.lang.String value)
Helper method to concatenate a parameter and its value to a pair that can
be used in an HTTP header.
|
static java.lang.String |
toQueryElement(java.lang.String name,
java.lang.String value)
Helper method to concatenate a parameter and its value to a pair that can
be used in an HTTP header.
|
static java.lang.String |
toQueryString(java.util.Map<java.lang.String,java.lang.String> parameters,
java.nio.charset.Charset encoding)
Converts the parameter to query string parameter.
|
static java.lang.String |
toSafeString(java.lang.Object source) |
static boolean |
usePayloadForQueryParameters(Request request)
Returns
true if the specified request has no payload and the POST method. |
public static final java.lang.String HEADER_ELEMENT_FORMAT
public static final java.lang.String QUERY_STRING_ELEMENT_FORMAT
public static boolean isUsingNonDefaultPort(java.net.URI uri)
true if the specified URI is using a non-standard port.uri - the URI object to determine the default port.true if the specified URI is using a non-standard port,
false otherwise.public static java.lang.String pathEncode(java.lang.String resourcePath)
public static boolean usePayloadForQueryParameters(Request request)
true if the specified request has no payload and the POST method.request - the Request to determine using payload for query parameter.true if the request has no payload and using payload for query
parameter, false otherwise.public static java.lang.String toSafeString(java.lang.Object source)
source - sourcepublic static java.lang.String percentEncode(java.util.Iterator<?> iterator)
iterator - the given Iterator object to encode.public static java.lang.String toQueryString(java.util.Map<java.lang.String,java.lang.String> parameters,
java.nio.charset.Charset encoding)
parameters - the given map of parameters.encoding - the given encoding.public static java.lang.String toHeaderElement(java.lang.String name,
java.lang.String value)
name - the OAuth parameter name, e.g. oauth_tokenvalue - the OAuth parameter value, e.g. 'hello oauth'public static java.lang.String toQueryElement(java.lang.String name,
java.lang.String value)
name - the OAuth parameter name, e.g. oauth_tokenvalue - the OAuth parameter value, e.g. 'hello oauth'public static java.lang.String format(java.lang.String template,
java.lang.Object... args)
%s in template with an argument. These
are matched by position - the first %s gets args[0], etc.
If there are more arguments than placeholders, the unmatched arguments will
be appended to the end of the formatted message in square braces.template - a non-null string containing 0 or more %s
placeholders.args - the arguments to be substituted into the message
template. Arguments are converted to strings using
String.valueOf(Object). Arguments can be null.