public class HttpImpl
extends java.lang.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(java.net.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(java.net.URI uri,
int timeout) |
boolean |
hasProxyConfig() |
protected boolean |
hasRequestHeader(org.apache.http.client.methods.RequestBuilder requestBuilder,
java.lang.String name) |
boolean |
isNonProxyHost(java.lang.String host) |
boolean |
isProxyHost(java.lang.String host) |
protected void |
processPostMethod(org.apache.http.client.methods.RequestBuilder requestBuilder,
java.util.Map<java.lang.String,java.lang.String> headers,
java.util.List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
java.util.List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
java.util.Map<java.lang.String,java.lang.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(java.util.List<org.apache.http.cookie.Cookie> httpCookies) |
byte[] |
URLtoByteArray(com.liferay.portal.kernel.util.Http.Options options) |
byte[] |
URLtoByteArray(java.lang.String location) |
byte[] |
URLtoByteArray(java.lang.String location,
boolean post) |
protected byte[] |
URLtoByteArray(java.lang.String location,
com.liferay.portal.kernel.util.Http.Method method,
java.util.Map<java.lang.String,java.lang.String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
java.util.List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
java.util.List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
java.util.Map<java.lang.String,java.lang.String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout) |
java.io.InputStream |
URLtoInputStream(com.liferay.portal.kernel.util.Http.Options options) |
java.io.InputStream |
URLtoInputStream(java.lang.String location) |
java.io.InputStream |
URLtoInputStream(java.lang.String location,
boolean post) |
protected java.io.InputStream |
URLtoInputStream(java.lang.String location,
com.liferay.portal.kernel.util.Http.Method method,
java.util.Map<java.lang.String,java.lang.String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
java.util.List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
java.util.List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
java.util.Map<java.lang.String,java.lang.String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout) |
java.lang.String |
URLtoString(com.liferay.portal.kernel.util.Http.Options options) |
java.lang.String |
URLtoString(java.lang.String location) |
java.lang.String |
URLtoString(java.lang.String location,
boolean post) |
java.lang.String |
URLtoString(java.net.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(java.lang.String host)
isNonProxyHost in interface com.liferay.portal.kernel.util.Httppublic boolean isProxyHost(java.lang.String host)
isProxyHost in interface com.liferay.portal.kernel.util.Httppublic byte[] URLtoByteArray(com.liferay.portal.kernel.util.Http.Options options)
throws java.io.IOException
URLtoByteArray in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic byte[] URLtoByteArray(java.lang.String location)
throws java.io.IOException
URLtoByteArray in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic byte[] URLtoByteArray(java.lang.String location,
boolean post)
throws java.io.IOException
URLtoByteArray in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic java.io.InputStream URLtoInputStream(com.liferay.portal.kernel.util.Http.Options options)
throws java.io.IOException
URLtoInputStream in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic java.io.InputStream URLtoInputStream(java.lang.String location)
throws java.io.IOException
URLtoInputStream in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic java.io.InputStream URLtoInputStream(java.lang.String location,
boolean post)
throws java.io.IOException
URLtoInputStream in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic java.lang.String URLtoString(com.liferay.portal.kernel.util.Http.Options options)
throws java.io.IOException
URLtoString in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic java.lang.String URLtoString(java.lang.String location)
throws java.io.IOException
URLtoString in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic java.lang.String URLtoString(java.lang.String location,
boolean post)
throws java.io.IOException
URLtoString in interface com.liferay.portal.kernel.util.Httpjava.io.IOExceptionpublic java.lang.String URLtoString(java.net.URL url)
throws java.io.IOException
URLtoString in interface com.liferay.portal.kernel.util.Httpurl - the URLjava.io.IOException - if an IO exception occurredprotected void addProxyCredentials(java.net.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(java.net.URI uri,
int timeout)
protected boolean hasRequestHeader(org.apache.http.client.methods.RequestBuilder requestBuilder,
java.lang.String name)
protected void processPostMethod(org.apache.http.client.methods.RequestBuilder requestBuilder,
java.util.Map<java.lang.String,java.lang.String> headers,
java.util.List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
java.util.List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
java.util.Map<java.lang.String,java.lang.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(java.util.List<org.apache.http.cookie.Cookie> httpCookies)
protected byte[] URLtoByteArray(java.lang.String location,
com.liferay.portal.kernel.util.Http.Method method,
java.util.Map<java.lang.String,java.lang.String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
java.util.List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
java.util.List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
java.util.Map<java.lang.String,java.lang.String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout)
throws java.io.IOException
java.io.IOExceptionprotected java.io.InputStream URLtoInputStream(java.lang.String location,
com.liferay.portal.kernel.util.Http.Method method,
java.util.Map<java.lang.String,java.lang.String> headers,
javax.servlet.http.Cookie[] cookies,
com.liferay.portal.kernel.util.Http.Auth auth,
com.liferay.portal.kernel.util.Http.Body body,
java.util.List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
java.util.List<com.liferay.portal.kernel.util.Http.InputStreamPart> inputStreamParts,
java.util.Map<java.lang.String,java.lang.String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
boolean normalizeURI,
int timeout)
throws java.io.IOException
java.io.IOException