public class AsyncHttpProviderUtils extends Object
AsyncHttpProvider
common utilities.
The cookies's handling code is from the Netty framework.Modifier and Type | Field and Description |
---|---|
static Charset |
DEFAULT_CHARSET |
static IOException |
REMOTELY_CLOSED_EXCEPTION |
Constructor and Description |
---|
AsyncHttpProviderUtils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
contentToByte(List<HttpResponseBodyPart> bodyParts) |
static InputStream |
contentToInputStream(List<HttpResponseBodyPart> bodyParts) |
static String |
contentToString(List<HttpResponseBodyPart> bodyParts,
Charset charset) |
static void |
encodeAndAppendQueryParam(StringBuilder sb,
CharSequence name,
CharSequence value) |
static boolean |
followRedirect(AsyncHttpClientConfig config,
Request request) |
static String |
getAuthority(Uri uri) |
static String |
getBaseUrl(Uri uri) |
static int |
getDefaultPort(Uri uri) |
static String |
getNonEmptyPath(Uri uri)
Convenient for HTTP layer when targeting server root
|
static String |
keepAliveHeaderValue(AsyncHttpClientConfig config) |
static String |
parseCharset(String contentType) |
static byte[] |
readFully(InputStream in,
int[] lengthWrapper) |
static int |
requestTimeout(AsyncHttpClientConfig config,
Request request) |
static String |
urlEncodeFormParams(List<Param> params) |
static void |
validateSupportedScheme(Uri uri) |
public static final IOException REMOTELY_CLOSED_EXCEPTION
public static final Charset DEFAULT_CHARSET
public static final void validateSupportedScheme(Uri uri)
public static final String contentToString(List<HttpResponseBodyPart> bodyParts, Charset charset) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final byte[] contentToByte(List<HttpResponseBodyPart> bodyParts) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final InputStream contentToInputStream(List<HttpResponseBodyPart> bodyParts) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final int getDefaultPort(Uri uri)
public static final String getNonEmptyPath(Uri uri)
public static final byte[] readFully(InputStream in, int[] lengthWrapper) throws IOException
IOException
public static String keepAliveHeaderValue(AsyncHttpClientConfig config)
public static int requestTimeout(AsyncHttpClientConfig config, Request request)
public static boolean followRedirect(AsyncHttpClientConfig config, Request request)
public static void encodeAndAppendQueryParam(StringBuilder sb, CharSequence name, CharSequence value)
Copyright © 2015. All Rights Reserved.