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) |
String |
decodePath(String path) |
String |
decodeURL(String url) |
String |
decodeURL(String url,
boolean unescapeSpaces)
Deprecated.
As of 7.0.0, replaced by
decodeURL(String) |
void |
destroy() |
String |
encodeParameters(String url) |
String |
encodePath(String path) |
String |
encodeURL(String url) |
String |
encodeURL(String url,
boolean escapeSpaces) |
String |
fixPath(String path) |
String |
fixPath(String path,
boolean leading,
boolean trailing) |
org.apache.commons.httpclient.HttpClient |
getClient(org.apache.commons.httpclient.HostConfiguration hostConfiguration) |
String |
getCompleteURL(javax.servlet.http.HttpServletRequest request) |
javax.servlet.http.Cookie[] |
getCookies() |
String |
getDomain(String url) |
org.apache.commons.httpclient.HostConfiguration |
getHostConfiguration(String location) |
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 request) |
String |
getProtocol(RenderRequest renderRequest) |
String |
getProtocol(String url) |
String |
getQueryString(String url) |
String |
getRequestURL(javax.servlet.http.HttpServletRequest request) |
boolean |
hasDomain(String url) |
boolean |
hasProtocol(String url) |
boolean |
hasProxyConfig() |
protected boolean |
hasRequestHeader(org.apache.commons.httpclient.HttpMethod httpMethod,
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) |
String |
protocolize(String url,
ActionRequest actionRequest) |
String |
protocolize(String url,
boolean secure) |
String |
protocolize(String url,
javax.servlet.http.HttpServletRequest request) |
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) |
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,
int count) |
protected org.apache.commons.httpclient.Cookie |
toCommonsCookie(javax.servlet.http.Cookie cookie) |
protected org.apache.commons.httpclient.Cookie[] |
toCommonsCookies(javax.servlet.http.Cookie[] cookies) |
protected org.apache.commons.httpclient.methods.multipart.FilePart |
toCommonsFilePart(com.liferay.portal.kernel.util.Http.FilePart filePart) |
protected javax.servlet.http.Cookie |
toServletCookie(org.apache.commons.httpclient.Cookie commonsCookie) |
protected javax.servlet.http.Cookie[] |
toServletCookies(org.apache.commons.httpclient.Cookie[] commonsCookies) |
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) |
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) |
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.Http@Deprecated public String decodeURL(String url, boolean unescapeSpaces)
decodeURL(String)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.Httppublic String encodeURL(String url)
encodeURL in interface com.liferay.portal.kernel.util.Httppublic String encodeURL(String url, boolean escapeSpaces)
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.Httppublic org.apache.commons.httpclient.HttpClient getClient(org.apache.commons.httpclient.HostConfiguration hostConfiguration)
public String getCompleteURL(javax.servlet.http.HttpServletRequest request)
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.Httppublic 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 request)
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 request)
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 request)
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.Httppublic 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, int count)
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 boolean hasRequestHeader(org.apache.commons.httpclient.HttpMethod httpMethod,
String name)
protected void processPostMethod(org.apache.commons.httpclient.methods.PostMethod postMethod,
List<com.liferay.portal.kernel.util.Http.FilePart> fileParts,
Map<String,String> parts)
protected org.apache.commons.httpclient.Cookie toCommonsCookie(javax.servlet.http.Cookie cookie)
protected org.apache.commons.httpclient.Cookie[] toCommonsCookies(javax.servlet.http.Cookie[] cookies)
protected org.apache.commons.httpclient.methods.multipart.FilePart toCommonsFilePart(com.liferay.portal.kernel.util.Http.FilePart filePart)
protected javax.servlet.http.Cookie toServletCookie(org.apache.commons.httpclient.Cookie commonsCookie)
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 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
IOException