public class HttpImpl
extends Object
implements com.liferay.portal.kernel.util.Http
com.liferay.portal.kernel.util.Http.Auth, com.liferay.portal.kernel.util.Http.Body, com.liferay.portal.kernel.util.Http.FilePart, com.liferay.portal.kernel.util.Http.InputStreamPart, com.liferay.portal.kernel.util.Http.Method, com.liferay.portal.kernel.util.Http.Options, com.liferay.portal.kernel.util.Http.Response| Constructor and Description |
|---|
HttpImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addProxyCredentials(URI uri,
org.apache.http.client.protocol.HttpClientContext httpClientContext) |
void |
destroy() |
protected org.apache.http.impl.client.CloseableHttpClient |
getCloseableHttpClient(org.apache.http.HttpHost proxyHost) |
javax.servlet.http.Cookie[] |
getCookies() |
protected org.apache.http.client.config.RequestConfig.Builder |
getRequestConfigBuilder(URI uri,
int timeout) |
boolean |
hasProxyConfig() |
protected boolean |
hasRequestHeader(org.apache.http.client.methods.RequestBuilder requestBuilder,
String name) |
boolean |
isNonProxyHost(String host) |
boolean |
isProxyHost(String host) |
protected void |
processPostMethod(org.apache.http.client.methods.RequestBuilder requestBuilder,
Map<String,String> headers,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
Map<String,String> parts) |
protected org.apache.http.cookie.Cookie |
toHttpCookie(javax.servlet.http.Cookie cookie) |
protected org.apache.http.cookie.Cookie[] |
toHttpCookies(javax.servlet.http.Cookie[] cookies) |
protected javax.servlet.http.Cookie |
toServletCookie(org.apache.http.cookie.Cookie httpCookie) |
protected javax.servlet.http.Cookie[] |
toServletCookies(List<org.apache.http.cookie.Cookie> httpCookies) |
byte[] |
URLtoByteArray(com.liferay.portal.kernel.util.Http.Options options) |
byte[] |
URLtoByteArray(String location) |
byte[] |
URLtoByteArray(String location,
boolean post) |
protected byte[] |
URLtoByteArray(String location,
com.liferay.portal.kernel.util.Http.Method method,
Map<String,String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout) |
InputStream |
URLtoInputStream(com.liferay.portal.kernel.util.Http.Options options) |
InputStream |
URLtoInputStream(String location) |
InputStream |
URLtoInputStream(String location,
boolean post) |
protected InputStream |
URLtoInputStream(String location,
com.liferay.portal.kernel.util.Http.Method method,
Map<String,String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout) |
String |
URLtoString(com.liferay.portal.kernel.util.Http.Options options) |
String |
URLtoString(String location) |
String |
URLtoString(String location,
boolean post) |
String |
URLtoString(URL url)
This method only uses the default Commons HttpClient implementation when
the URL object represents a HTTP resource.
|
public void destroy()
public javax.servlet.http.Cookie[] getCookies()
getCookies in interface com.liferay.portal.kernel.util.Httppublic boolean hasProxyConfig()
hasProxyConfig in interface com.liferay.portal.kernel.util.Httppublic boolean isNonProxyHost(String host)
isNonProxyHost in interface com.liferay.portal.kernel.util.Httppublic boolean isProxyHost(String host)
isProxyHost in interface com.liferay.portal.kernel.util.Httppublic byte[] URLtoByteArray(com.liferay.portal.kernel.util.Http.Options options)
throws IOException
URLtoByteArray in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic byte[] URLtoByteArray(String location)
throws IOException
URLtoByteArray in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic byte[] URLtoByteArray(String location,
boolean post)
throws IOException
URLtoByteArray in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic InputStream URLtoInputStream(com.liferay.portal.kernel.util.Http.Options options)
throws IOException
URLtoInputStream in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic InputStream URLtoInputStream(String location)
throws IOException
URLtoInputStream in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic InputStream URLtoInputStream(String location,
boolean post)
throws IOException
URLtoInputStream in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic String URLtoString(com.liferay.portal.kernel.util.Http.Options options)
throws IOException
URLtoString in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic String URLtoString(String location)
throws IOException
URLtoString in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic String URLtoString(String location,
boolean post)
throws IOException
URLtoString in interface com.liferay.portal.kernel.util.HttpIOExceptionpublic String URLtoString(URL url)
throws IOException
URLtoString in interface com.liferay.portal.kernel.util.Httpurl - the URLIOException - if an IO exception occurredprotected void addProxyCredentials(URI uri,
org.apache.http.client.protocol.HttpClientContext httpClientContext)
protected org.apache.http.impl.client.CloseableHttpClient getCloseableHttpClient(org.apache.http.HttpHost proxyHost)
protected org.apache.http.client.config.RequestConfig.Builder getRequestConfigBuilder(URI uri,
int timeout)
protected boolean hasRequestHeader(org.apache.http.client.methods.RequestBuilder requestBuilder,
String name)
protected void processPostMethod(org.apache.http.client.methods.RequestBuilder requestBuilder,
Map<String,String> headers,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
Map<String,String> parts)
protected org.apache.http.cookie.Cookie toHttpCookie(javax.servlet.http.Cookie cookie)
protected org.apache.http.cookie.Cookie[] toHttpCookies(javax.servlet.http.Cookie[] cookies)
protected javax.servlet.http.Cookie toServletCookie(org.apache.http.cookie.Cookie httpCookie)
protected javax.servlet.http.Cookie[] toServletCookies(List<org.apache.http.cookie.Cookie> httpCookies)
protected byte[] URLtoByteArray(String location,
com.liferay.portal.kernel.util.Http.Method method,
Map<String,String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout)
throws IOException
IOExceptionprotected InputStream URLtoInputStream(String location,
com.liferay.portal.kernel.util.Http.Method method,
Map<String,String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout)
throws IOException
IOException