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.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 |
|---|---|
String |
addParameter(String url,
String name,
boolean value) |
String |
addParameter(String url,
String name,
double value) |
String |
addParameter(String url,
String name,
int value) |
String |
addParameter(String url,
String name,
long value) |
String |
addParameter(String url,
String name,
short value) |
String |
addParameter(String url,
String name,
String value) |
protected void |
addProxyCredentials(URI uri,
org.apache.http.client.protocol.HttpClientContext httpClientContext) |
String |
decodePath(String path) |
String |
decodeURL(String url) |
void |
destroy() |
String |
encodeParameters(String url) |
String |
encodePath(String path) |
String |
encodeURL(String url)
Deprecated.
As of Judson (7.1.x), replaced by
URLCodec.encodeURL(String) |
String |
encodeURL(String url,
boolean escapeSpaces)
Deprecated.
As of Judson (7.1.x), replaced by
URLCodec.encodeURL(String, boolean) |
String |
fixPath(String path) |
String |
fixPath(String path,
boolean leading,
boolean trailing) |
org.apache.commons.httpclient.HttpClient |
getClient(org.apache.commons.httpclient.HostConfiguration hostConfiguration)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected org.apache.http.impl.client.CloseableHttpClient |
getCloseableHttpClient(org.apache.http.HttpHost proxyHost) |
String |
getCompleteURL(javax.servlet.http.HttpServletRequest httpServletRequest) |
javax.servlet.http.Cookie[] |
getCookies() |
String |
getDomain(String url) |
org.apache.commons.httpclient.HostConfiguration |
getHostConfiguration(String location)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
String |
getIpAddress(String url) |
String |
getParameter(String url,
String name) |
String |
getParameter(String url,
String name,
boolean escaped) |
Map<String,String[]> |
getParameterMap(String queryString) |
String |
getPath(String url) |
String |
getProtocol(ActionRequest actionRequest) |
String |
getProtocol(boolean secure) |
String |
getProtocol(javax.servlet.http.HttpServletRequest httpServletRequest) |
String |
getProtocol(RenderRequest renderRequest) |
String |
getProtocol(String url) |
String |
getQueryString(String url) |
protected org.apache.http.client.config.RequestConfig.Builder |
getRequestConfigBuilder(URI uri,
int timeout) |
String |
getRequestURL(javax.servlet.http.HttpServletRequest httpServletRequest) |
boolean |
hasDomain(String url) |
boolean |
hasProtocol(String url) |
boolean |
hasProxyConfig() |
protected boolean |
hasRequestHeader(org.apache.commons.httpclient.HttpMethod httpMethod,
String name)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected boolean |
hasRequestHeader(org.apache.http.client.methods.RequestBuilder requestBuilder,
String name) |
boolean |
isNonProxyHost(String host) |
boolean |
isProxyHost(String host) |
boolean |
isSecure(String url) |
String |
normalizePath(String uri) |
Map<String,String[]> |
parameterMapFromString(String queryString) |
String |
parameterMapToString(Map<String,String[]> parameterMap) |
String |
parameterMapToString(Map<String,String[]> parameterMap,
boolean addQuestion) |
protected void |
processPostMethod(org.apache.commons.httpclient.methods.PostMethod postMethod,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
Map<String,String> parts)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected void |
processPostMethod(org.apache.http.client.methods.RequestBuilder requestBuilder,
Map<String,String> headers,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
Map<String,String> parts) |
String |
protocolize(String url,
ActionRequest actionRequest) |
String |
protocolize(String url,
boolean secure) |
String |
protocolize(String url,
javax.servlet.http.HttpServletRequest httpServletRequest) |
String |
protocolize(String url,
int port,
boolean secure) |
String |
protocolize(String url,
RenderRequest renderRequest) |
void |
proxifyState(org.apache.commons.httpclient.HttpState httpState,
org.apache.commons.httpclient.HostConfiguration hostConfiguration)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
String |
removeDomain(String url) |
String |
removeParameter(String url,
String name) |
String |
removePathParameters(String uri) |
String |
removeProtocol(String url) |
String |
sanitizeHeader(String header) |
String |
setParameter(String url,
String name,
boolean value) |
String |
setParameter(String url,
String name,
double value) |
String |
setParameter(String url,
String name,
int value) |
String |
setParameter(String url,
String name,
long value) |
String |
setParameter(String url,
String name,
short value) |
String |
setParameter(String url,
String name,
String value) |
String |
shortenURL(String url) |
String |
shortenURL(String url,
int count)
Deprecated.
As of Judson (7.1.x), replaced by
shortenURL(String) |
protected org.apache.commons.httpclient.Cookie |
toCommonsCookie(javax.servlet.http.Cookie cookie)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected org.apache.commons.httpclient.Cookie[] |
toCommonsCookies(javax.servlet.http.Cookie[] cookie)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected org.apache.commons.httpclient.methods.multipart.FilePart |
toCommonsFilePart(com.liferay.portal.kernel.util.Http.FilePart filePart)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
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.commons.httpclient.Cookie commonsCookie)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected javax.servlet.http.Cookie |
toServletCookie(org.apache.http.cookie.Cookie httpCookie) |
protected javax.servlet.http.Cookie[] |
toServletCookies(org.apache.commons.httpclient.Cookie[] commonsCookies)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects) |
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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects) |
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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
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 String addParameter(String url,
String name,
boolean value)
addParameter in interface com.liferay.portal.kernel.util.Httppublic String addParameter(String url,
String name,
double value)
addParameter in interface com.liferay.portal.kernel.util.Httppublic String addParameter(String url,
String name,
int value)
addParameter in interface com.liferay.portal.kernel.util.Httppublic String addParameter(String url,
String name,
long value)
addParameter in interface com.liferay.portal.kernel.util.Httppublic String addParameter(String url,
String name,
short value)
addParameter in interface com.liferay.portal.kernel.util.Httppublic String addParameter(String url,
String name,
String value)
addParameter in interface com.liferay.portal.kernel.util.Httppublic String decodePath(String path)
decodePath in interface com.liferay.portal.kernel.util.Httppublic String decodeURL(String url)
decodeURL in interface com.liferay.portal.kernel.util.Httppublic void destroy()
public String encodeParameters(String url)
encodeParameters in interface com.liferay.portal.kernel.util.Httppublic String encodePath(String path)
encodePath in interface com.liferay.portal.kernel.util.Http@Deprecated public String encodeURL(String url)
URLCodec.encodeURL(String)encodeURL in interface com.liferay.portal.kernel.util.Http@Deprecated
public String encodeURL(String url,
boolean escapeSpaces)
URLCodec.encodeURL(String, boolean)encodeURL in interface com.liferay.portal.kernel.util.Httppublic String fixPath(String path)
fixPath in interface com.liferay.portal.kernel.util.Httppublic String fixPath(String path,
boolean leading,
boolean trailing)
fixPath in interface com.liferay.portal.kernel.util.Http@Deprecated public org.apache.commons.httpclient.HttpClient getClient(org.apache.commons.httpclient.HostConfiguration hostConfiguration)
public String getCompleteURL(javax.servlet.http.HttpServletRequest httpServletRequest)
getCompleteURL in interface com.liferay.portal.kernel.util.Httppublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface com.liferay.portal.kernel.util.Httppublic String getDomain(String url)
getDomain in interface com.liferay.portal.kernel.util.Http@Deprecated
public org.apache.commons.httpclient.HostConfiguration getHostConfiguration(String location)
throws IOException
IOExceptionpublic String getIpAddress(String url)
getIpAddress in interface com.liferay.portal.kernel.util.Httppublic String getParameter(String url,
String name)
getParameter in interface com.liferay.portal.kernel.util.Httppublic String getParameter(String url,
String name,
boolean escaped)
getParameter in interface com.liferay.portal.kernel.util.Httppublic Map<String,String[]> getParameterMap(String queryString)
getParameterMap in interface com.liferay.portal.kernel.util.Httppublic String getPath(String url)
getPath in interface com.liferay.portal.kernel.util.Httppublic String getProtocol(ActionRequest actionRequest)
getProtocol in interface com.liferay.portal.kernel.util.Httppublic String getProtocol(boolean secure)
getProtocol in interface com.liferay.portal.kernel.util.Httppublic String getProtocol(javax.servlet.http.HttpServletRequest httpServletRequest)
getProtocol in interface com.liferay.portal.kernel.util.Httppublic String getProtocol(RenderRequest renderRequest)
getProtocol in interface com.liferay.portal.kernel.util.Httppublic String getProtocol(String url)
getProtocol in interface com.liferay.portal.kernel.util.Httppublic String getQueryString(String url)
getQueryString in interface com.liferay.portal.kernel.util.Httppublic String getRequestURL(javax.servlet.http.HttpServletRequest httpServletRequest)
getRequestURL in interface com.liferay.portal.kernel.util.Httppublic boolean hasDomain(String url)
hasDomain in interface com.liferay.portal.kernel.util.Httppublic boolean hasProtocol(String url)
hasProtocol 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 boolean isSecure(String url)
isSecure in interface com.liferay.portal.kernel.util.Httppublic String normalizePath(String uri)
normalizePath in interface com.liferay.portal.kernel.util.Httppublic Map<String,String[]> parameterMapFromString(String queryString)
parameterMapFromString in interface com.liferay.portal.kernel.util.Httppublic String parameterMapToString(Map<String,String[]> parameterMap)
parameterMapToString in interface com.liferay.portal.kernel.util.Httppublic String parameterMapToString(Map<String,String[]> parameterMap,
boolean addQuestion)
parameterMapToString in interface com.liferay.portal.kernel.util.Httppublic String protocolize(String url,
ActionRequest actionRequest)
protocolize in interface com.liferay.portal.kernel.util.Httppublic String protocolize(String url,
boolean secure)
protocolize in interface com.liferay.portal.kernel.util.Httppublic String protocolize(String url,
javax.servlet.http.HttpServletRequest httpServletRequest)
protocolize in interface com.liferay.portal.kernel.util.Httppublic String protocolize(String url,
int port,
boolean secure)
protocolize in interface com.liferay.portal.kernel.util.Httppublic String protocolize(String url,
RenderRequest renderRequest)
protocolize in interface com.liferay.portal.kernel.util.Http@Deprecated
public void proxifyState(org.apache.commons.httpclient.HttpState httpState,
org.apache.commons.httpclient.HostConfiguration hostConfiguration)
public String removeDomain(String url)
removeDomain in interface com.liferay.portal.kernel.util.Httppublic String removeParameter(String url,
String name)
removeParameter in interface com.liferay.portal.kernel.util.Httppublic String removePathParameters(String uri)
removePathParameters in interface com.liferay.portal.kernel.util.Httppublic String removeProtocol(String url)
removeProtocol in interface com.liferay.portal.kernel.util.Httppublic String sanitizeHeader(String header)
sanitizeHeader in interface com.liferay.portal.kernel.util.Httppublic String setParameter(String url,
String name,
boolean value)
setParameter in interface com.liferay.portal.kernel.util.Httppublic String setParameter(String url,
String name,
double value)
setParameter in interface com.liferay.portal.kernel.util.Httppublic String setParameter(String url,
String name,
int value)
setParameter in interface com.liferay.portal.kernel.util.Httppublic String setParameter(String url,
String name,
long value)
setParameter in interface com.liferay.portal.kernel.util.Httppublic String setParameter(String url,
String name,
short value)
setParameter in interface com.liferay.portal.kernel.util.Httppublic String setParameter(String url,
String name,
String value)
setParameter in interface com.liferay.portal.kernel.util.Httppublic String shortenURL(String url)
shortenURL in interface com.liferay.portal.kernel.util.Http@Deprecated
public String shortenURL(String url,
int count)
shortenURL(String)shortenURL 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)
@Deprecated
protected boolean hasRequestHeader(org.apache.commons.httpclient.HttpMethod httpMethod,
String name)
protected boolean hasRequestHeader(org.apache.http.client.methods.RequestBuilder requestBuilder,
String name)
@Deprecated
protected void processPostMethod(org.apache.commons.httpclient.methods.PostMethod postMethod,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
Map<String,String> parts)
protected void processPostMethod(org.apache.http.client.methods.RequestBuilder requestBuilder,
Map<String,String> headers,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
Map<String,String> parts)
@Deprecated protected org.apache.commons.httpclient.Cookie toCommonsCookie(javax.servlet.http.Cookie cookie)
@Deprecated protected org.apache.commons.httpclient.Cookie[] toCommonsCookies(javax.servlet.http.Cookie[] cookie)
@Deprecated protected org.apache.commons.httpclient.methods.multipart.FilePart toCommonsFilePart(com.liferay.portal.kernel.util.Http.FilePart filePart)
protected org.apache.http.cookie.Cookie toHttpCookie(javax.servlet.http.Cookie cookie)
protected org.apache.http.cookie.Cookie[] toHttpCookies(javax.servlet.http.Cookie[] cookies)
@Deprecated protected javax.servlet.http.Cookie toServletCookie(org.apache.commons.httpclient.Cookie commonsCookie)
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)
@Deprecated protected javax.servlet.http.Cookie[] toServletCookies(org.apache.commons.httpclient.Cookie[] commonsCookies)
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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects)
throws IOException
IOExceptionprotected 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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects)
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,
Map<String,String> parts,
com.liferay.portal.kernel.util.Http.Response response,
boolean followRedirects,
int timeout)
throws IOException
IOException