com.liferay.portal.util
Class HttpImpl
java.lang.Object
com.liferay.portal.util.HttpImpl
- All Implemented Interfaces:
- Http
public class HttpImpl
- extends Object
- implements Http
Method Summary |
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 unescapeSpace)
|
void |
destroy()
|
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 hostConfig)
|
String |
getCompleteURL(javax.servlet.http.HttpServletRequest request)
|
javax.servlet.http.Cookie[] |
getCookies()
|
String |
getDomain(String url)
|
org.apache.commons.httpclient.HostConfiguration |
getHostConfig(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 |
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()
|
boolean |
isNonProxyHost(String host)
|
boolean |
isProxyHost(String host)
|
Map<String,String[]> |
parameterMapFromString(String queryString)
|
String |
parameterMapToString(Map<String,String[]> parameterMap)
|
String |
parameterMapToString(Map<String,String[]> parameterMap,
boolean addQuestion)
|
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,
RenderRequest renderRequest)
|
protected void |
proxifyState(org.apache.commons.httpclient.HttpState state,
org.apache.commons.httpclient.HostConfiguration hostConfig)
|
String |
removeDomain(String url)
|
String |
removeParameter(String url,
String name)
|
String |
removeProtocol(String url)
|
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)
|
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 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(Http.Options options)
|
byte[] |
URLtoByteArray(String location)
|
byte[] |
URLtoByteArray(String location,
boolean post)
|
protected byte[] |
URLtoByteArray(String location,
Http.Method method,
Map<String,String> headers,
javax.servlet.http.Cookie[] cookies,
Http.Auth auth,
Http.Body body,
Map<String,String> parts,
Http.Response response,
boolean followRedirects)
|
String |
URLtoString(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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpImpl
public HttpImpl()
addParameter
public String addParameter(String url,
String name,
boolean value)
- Specified by:
addParameter
in interface Http
addParameter
public String addParameter(String url,
String name,
double value)
- Specified by:
addParameter
in interface Http
addParameter
public String addParameter(String url,
String name,
int value)
- Specified by:
addParameter
in interface Http
addParameter
public String addParameter(String url,
String name,
long value)
- Specified by:
addParameter
in interface Http
addParameter
public String addParameter(String url,
String name,
short value)
- Specified by:
addParameter
in interface Http
addParameter
public String addParameter(String url,
String name,
String value)
- Specified by:
addParameter
in interface Http
decodePath
public String decodePath(String path)
- Specified by:
decodePath
in interface Http
decodeURL
public String decodeURL(String url)
- Specified by:
decodeURL
in interface Http
decodeURL
public String decodeURL(String url,
boolean unescapeSpace)
- Specified by:
decodeURL
in interface Http
destroy
public void destroy()
encodePath
public String encodePath(String path)
- Specified by:
encodePath
in interface Http
encodeURL
public String encodeURL(String url)
- Specified by:
encodeURL
in interface Http
encodeURL
public String encodeURL(String url,
boolean escapeSpaces)
- Specified by:
encodeURL
in interface Http
fixPath
public String fixPath(String path)
- Specified by:
fixPath
in interface Http
fixPath
public String fixPath(String path,
boolean leading,
boolean trailing)
- Specified by:
fixPath
in interface Http
getClient
public org.apache.commons.httpclient.HttpClient getClient(org.apache.commons.httpclient.HostConfiguration hostConfig)
getCompleteURL
public String getCompleteURL(javax.servlet.http.HttpServletRequest request)
- Specified by:
getCompleteURL
in interface Http
getCookies
public javax.servlet.http.Cookie[] getCookies()
- Specified by:
getCookies
in interface Http
getDomain
public String getDomain(String url)
- Specified by:
getDomain
in interface Http
getHostConfig
public org.apache.commons.httpclient.HostConfiguration getHostConfig(String location)
throws IOException
- Throws:
IOException
getIpAddress
public String getIpAddress(String url)
- Specified by:
getIpAddress
in interface Http
getParameter
public String getParameter(String url,
String name)
- Specified by:
getParameter
in interface Http
getParameter
public String getParameter(String url,
String name,
boolean escaped)
- Specified by:
getParameter
in interface Http
getParameterMap
public Map<String,String[]> getParameterMap(String queryString)
- Specified by:
getParameterMap
in interface Http
getProtocol
public String getProtocol(ActionRequest actionRequest)
- Specified by:
getProtocol
in interface Http
getProtocol
public String getProtocol(boolean secure)
- Specified by:
getProtocol
in interface Http
getProtocol
public String getProtocol(javax.servlet.http.HttpServletRequest request)
- Specified by:
getProtocol
in interface Http
getProtocol
public String getProtocol(RenderRequest renderRequest)
- Specified by:
getProtocol
in interface Http
getProtocol
public String getProtocol(String url)
- Specified by:
getProtocol
in interface Http
getQueryString
public String getQueryString(String url)
- Specified by:
getQueryString
in interface Http
getRequestURL
public String getRequestURL(javax.servlet.http.HttpServletRequest request)
- Specified by:
getRequestURL
in interface Http
hasDomain
public boolean hasDomain(String url)
- Specified by:
hasDomain
in interface Http
hasProtocol
public boolean hasProtocol(String url)
- Specified by:
hasProtocol
in interface Http
hasProxyConfig
public boolean hasProxyConfig()
- Specified by:
hasProxyConfig
in interface Http
isNonProxyHost
public boolean isNonProxyHost(String host)
- Specified by:
isNonProxyHost
in interface Http
isProxyHost
public boolean isProxyHost(String host)
- Specified by:
isProxyHost
in interface Http
parameterMapFromString
public Map<String,String[]> parameterMapFromString(String queryString)
- Specified by:
parameterMapFromString
in interface Http
parameterMapToString
public String parameterMapToString(Map<String,String[]> parameterMap)
- Specified by:
parameterMapToString
in interface Http
parameterMapToString
public String parameterMapToString(Map<String,String[]> parameterMap,
boolean addQuestion)
- Specified by:
parameterMapToString
in interface Http
protocolize
public String protocolize(String url,
ActionRequest actionRequest)
- Specified by:
protocolize
in interface Http
protocolize
public String protocolize(String url,
boolean secure)
- Specified by:
protocolize
in interface Http
protocolize
public String protocolize(String url,
javax.servlet.http.HttpServletRequest request)
- Specified by:
protocolize
in interface Http
protocolize
public String protocolize(String url,
RenderRequest renderRequest)
- Specified by:
protocolize
in interface Http
removeDomain
public String removeDomain(String url)
- Specified by:
removeDomain
in interface Http
removeParameter
public String removeParameter(String url,
String name)
- Specified by:
removeParameter
in interface Http
removeProtocol
public String removeProtocol(String url)
- Specified by:
removeProtocol
in interface Http
setParameter
public String setParameter(String url,
String name,
boolean value)
- Specified by:
setParameter
in interface Http
setParameter
public String setParameter(String url,
String name,
double value)
- Specified by:
setParameter
in interface Http
setParameter
public String setParameter(String url,
String name,
int value)
- Specified by:
setParameter
in interface Http
setParameter
public String setParameter(String url,
String name,
long value)
- Specified by:
setParameter
in interface Http
setParameter
public String setParameter(String url,
String name,
short value)
- Specified by:
setParameter
in interface Http
setParameter
public String setParameter(String url,
String name,
String value)
- Specified by:
setParameter
in interface Http
URLtoByteArray
public byte[] URLtoByteArray(Http.Options options)
throws IOException
- Specified by:
URLtoByteArray
in interface Http
- Throws:
IOException
URLtoByteArray
public byte[] URLtoByteArray(String location)
throws IOException
- Specified by:
URLtoByteArray
in interface Http
- Throws:
IOException
URLtoByteArray
public byte[] URLtoByteArray(String location,
boolean post)
throws IOException
- Specified by:
URLtoByteArray
in interface Http
- Throws:
IOException
URLtoString
public String URLtoString(Http.Options options)
throws IOException
- Specified by:
URLtoString
in interface Http
- Throws:
IOException
URLtoString
public String URLtoString(String location)
throws IOException
- Specified by:
URLtoString
in interface Http
- Throws:
IOException
URLtoString
public String URLtoString(String location,
boolean post)
throws IOException
- Specified by:
URLtoString
in interface Http
- Throws:
IOException
URLtoString
public String URLtoString(URL url)
throws IOException
- This method only uses the default Commons HttpClient implementation when
the URL object represents a HTTP resource. The URL object could also
represent a file or some JNDI resource. In that case, the default Java
implementation is used.
- Specified by:
URLtoString
in interface Http
- Returns:
- A string representation of the resource referenced by the URL
object
- Throws:
IOException
proxifyState
protected void proxifyState(org.apache.commons.httpclient.HttpState state,
org.apache.commons.httpclient.HostConfiguration hostConfig)
toCommonsCookie
protected org.apache.commons.httpclient.Cookie toCommonsCookie(javax.servlet.http.Cookie cookie)
toCommonsCookies
protected org.apache.commons.httpclient.Cookie[] toCommonsCookies(javax.servlet.http.Cookie[] cookies)
toServletCookie
protected javax.servlet.http.Cookie toServletCookie(org.apache.commons.httpclient.Cookie commonsCookie)
toServletCookies
protected javax.servlet.http.Cookie[] toServletCookies(org.apache.commons.httpclient.Cookie[] commonsCookies)
URLtoByteArray
protected byte[] URLtoByteArray(String location,
Http.Method method,
Map<String,String> headers,
javax.servlet.http.Cookie[] cookies,
Http.Auth auth,
Http.Body body,
Map<String,String> parts,
Http.Response response,
boolean followRedirects)
throws IOException
- Throws:
IOException