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 |
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 boolean |
followRedirect(AsyncHttpClientConfig config,
Request request) |
static String |
formParams2UTF8String(List<Param> params) |
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 void |
validateSupportedScheme(Uri uri) |
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)
Copyright © 2014. All Rights Reserved.