public final class HttpClientConverter extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FORBIDDEN
Deprecated.
as of version 4.1.0; use
HttpStatus.FORBIDDEN_403 instead |
static int |
INTERNAL_SERVER_ERROR
Deprecated.
as of version 4.1.0; use
HttpStatus.INTERNAL_SERVER_ERROR_500 instead |
static int |
MOVED_PERMANENTLY
Deprecated.
as of version 4.1.0; use
HttpStatus.MOVED_PERMANENTLY_301 instead |
static int |
MOVED_TEMPORARILY
Deprecated.
as of version 4.1.0; use
HttpStatus.FOUND_302 instead |
static int |
MULTIPLE_CHOICES
Deprecated.
as of version 4.1.0; use
HttpStatus.MULTIPLE_CHOICES_300 instead |
static int |
NO_CONTENT
Deprecated.
as of version 4.1.0; use
HttpStatus.NO_CONTENT_204 instead |
static int |
NOT_FOUND
Deprecated.
as of version 4.1.0; use
HttpStatus.NOT_FOUND_404 instead |
static int |
NOT_MODIFIED
Deprecated.
as of version 4.1.0; use
HttpStatus.NOT_MODIFIED_304 instead |
static int |
OK
Deprecated.
as of version 4.1.0; use
HttpStatus.OK_200 instead |
static int |
PERMANENT_REDIRECT
Deprecated.
as of version 4.1.0; use
HttpStatus.PERMANENT_REDIRECT_308 instead |
static int |
SEE_OTHER
Deprecated.
as of version 4.1.0; use
HttpStatus.SEE_OTHER_303 instead |
static int |
TEMPORARY_REDIRECT
Deprecated.
as of version 4.1.0; use
HttpStatus.TEMPORARY_REDIRECT_307 instead |
static int |
USE_PROXY
Deprecated.
as of version 4.1.0; use
HttpStatus.USE_PROXY_305 instead |
Modifier and Type | Method and Description |
---|---|
static void |
addMatching(Set<Cookie> cookies,
URL normalizedUrl,
BrowserVersion browserVersion,
Set<Cookie> matches) |
static org.apache.http.cookie.CookieOrigin |
buildCookieOrigin(URL url)
Helper that builds a CookieOrigin.
|
static String |
formatDate(Date date)
Deprecated.
as of version 4.1.0; use
HttpUtils.parseDate(String) instead |
static List<Cookie> |
fromHttpClient(List<org.apache.http.cookie.Cookie> cookies)
Converts the specified array of HttpClient cookies into a list of cookies.
|
static boolean |
isNoHttpResponseException(Exception e) |
static List<org.apache.http.NameValuePair> |
nameValuePairsToHttpClient(List<NameValuePair> pairs)
Converts the specified name/value pairs into HttpClient name/value pairs.
|
static List<Cookie> |
parseCookie(String cookieString,
URL pageUrl,
BrowserVersion browserVersion) |
static Date |
parseHttpDate(String s)
Deprecated.
as of version 4.1.0; use
HttpUtils.parseDate(String) instead |
static List<NameValuePair> |
parseUrlQuery(String query,
Charset charset)
Deprecated.
as of version 4.1.0; use
HttpUtils.parseUrlQuery(String, Charset) instead |
static URL |
replaceForCookieIfNecessary(URL url)
CookieOrigin doesn't like empty hosts and negative ports,
but these things happen if we're dealing with a local file. |
static List<org.apache.http.cookie.Cookie> |
toHttpClient(Collection<Cookie> cookies)
Converts the specified collection of cookies into a collection of HttpClient cookies.
|
static String |
toQueryFormFields(List<NameValuePair> parameters,
Charset enc)
Deprecated.
as of version 4.1.0; use
HttpUtils.toQueryFormFields(Iterable, Charset) instead |
@Deprecated public static final int OK
HttpStatus.OK_200
instead@Deprecated public static final int NO_CONTENT
HttpStatus.NO_CONTENT_204
instead@Deprecated public static final int MULTIPLE_CHOICES
HttpStatus.MULTIPLE_CHOICES_300
instead@Deprecated public static final int MOVED_PERMANENTLY
HttpStatus.MOVED_PERMANENTLY_301
instead@Deprecated public static final int MOVED_TEMPORARILY
HttpStatus.FOUND_302
instead@Deprecated public static final int SEE_OTHER
HttpStatus.SEE_OTHER_303
instead@Deprecated public static final int TEMPORARY_REDIRECT
HttpStatus.TEMPORARY_REDIRECT_307
instead@Deprecated public static final int PERMANENT_REDIRECT
HttpStatus.PERMANENT_REDIRECT_308
instead@Deprecated public static final int NOT_MODIFIED
HttpStatus.NOT_MODIFIED_304
instead@Deprecated public static final int USE_PROXY
HttpStatus.USE_PROXY_305
instead@Deprecated public static final int FORBIDDEN
HttpStatus.FORBIDDEN_403
instead@Deprecated public static final int NOT_FOUND
HttpStatus.NOT_FOUND_404
instead@Deprecated public static final int INTERNAL_SERVER_ERROR
HttpStatus.INTERNAL_SERVER_ERROR_500
insteadpublic static List<org.apache.http.NameValuePair> nameValuePairsToHttpClient(List<NameValuePair> pairs)
pairs
- the name/value pairs to convert@Deprecated public static List<NameValuePair> parseUrlQuery(String query, Charset charset)
HttpUtils.parseUrlQuery(String, Charset)
insteadquery
- the urlencoded querycharset
- the charset or null (defaulting to utf-8)@Deprecated public static String toQueryFormFields(List<NameValuePair> parameters, Charset enc)
HttpUtils.toQueryFormFields(Iterable, Charset)
insteadparameters
- the paramtersenc
- the charset@Deprecated public static Date parseHttpDate(String s)
HttpUtils.parseDate(String)
insteadnull
if the specified string is null
or unparseable.s
- the string to parse as a datenull
@Deprecated public static String formatDate(Date date)
HttpUtils.parseDate(String)
insteaddate
- The date to format.public static boolean isNoHttpResponseException(Exception e)
e
- the exception to checkNoHttpResponseException
public static org.apache.http.cookie.CookieOrigin buildCookieOrigin(URL url)
url
- the url to be usedpublic static URL replaceForCookieIfNecessary(URL url)
CookieOrigin
doesn't like empty hosts and negative ports,
but these things happen if we're dealing with a local file.
This method allows us to work around this limitation in HttpClient by feeding it a bogus host and port.url
- the URL to replace if necessarypublic static List<Cookie> parseCookie(String cookieString, URL pageUrl, BrowserVersion browserVersion) throws org.apache.http.cookie.MalformedCookieException
org.apache.http.cookie.MalformedCookieException
public static List<org.apache.http.cookie.Cookie> toHttpClient(Collection<Cookie> cookies)
cookies
- the cookies to be convertedpublic static List<Cookie> fromHttpClient(List<org.apache.http.cookie.Cookie> cookies)
cookies
- the cookies to be convertedCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.