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 String |
DEFAULT_CHARSET |
protected static ThreadLocal<SimpleDateFormat[]> |
simpleDateFormat |
Constructor and Description |
---|
AsyncHttpProviderUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkBodyParts(int statusCode,
Collection<HttpResponseBodyPart> bodyParts) |
static String |
constructUserAgent(Class<? extends AsyncHttpProvider> httpProvider) |
static MultipartRequestEntity |
createMultipartRequestEntity(List<Part> params,
FluentStringsMap methodParams)
This is quite ugly as our internal names are duplicated, but we build on top of HTTP Client implementation.
|
static URI |
createUri(String u) |
static String |
encodeCookies(Collection<Cookie> cookies) |
static SimpleDateFormat[] |
get() |
static String |
getAuthority(URI uri) |
static String |
getBaseUrl(URI uri) |
static int |
getPort(URI uri) |
static URI |
getRedirectUri(URI uri,
String location) |
static String |
parseCharset(String contentType) |
static Cookie |
parseCookie(String value) |
static byte[] |
readFully(InputStream in,
int[] lengthWrapper) |
public static final String DEFAULT_CHARSET
protected static final ThreadLocal<SimpleDateFormat[]> simpleDateFormat
public static final SimpleDateFormat[] get()
public static final int getPort(URI uri)
public static final MultipartRequestEntity createMultipartRequestEntity(List<Part> params, FluentStringsMap methodParams) throws FileNotFoundException
params
- methodParams
- FileNotFoundException
public static final byte[] readFully(InputStream in, int[] lengthWrapper) throws IOException
IOException
public static String encodeCookies(Collection<Cookie> cookies)
public static String constructUserAgent(Class<? extends AsyncHttpProvider> httpProvider)
public static void checkBodyParts(int statusCode, Collection<HttpResponseBodyPart> bodyParts)
Copyright © 2015. All rights reserved.