Liferay 6.2-ce-ga5

com.liferay.portal.util
Class HttpImpl

java.lang.Object
  extended by com.liferay.portal.util.HttpImpl
All Implemented Interfaces:
Http

public class HttpImpl
extends Object
implements Http


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.liferay.portal.kernel.util.Http
Http.Auth, Http.Body, Http.FilePart, Http.Method, Http.Options, Http.Response
 
Field Summary
 
Fields inherited from interface com.liferay.portal.kernel.util.Http
HTTP, HTTP_PORT, HTTP_WITH_SLASH, HTTPS, HTTPS_PORT, HTTPS_WITH_SLASH, PROTOCOL_DELIMITER, URL_MAXIMUM_LENGTH
 
Constructor Summary
HttpImpl()
           
 
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 unescapeSpaces)
           
 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 getHostConfig(String location)
          Deprecated. As of 6.1.0, replaced by getHostConfiguration(String)
 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)
           
 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<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 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(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(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, List<Http.FilePart> fileParts, Map<String,String> parts, Http.Response response, boolean followRedirects, String progressId, PortletRequest portletRequest)
           
 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
 

Constructor Detail

HttpImpl

public HttpImpl()
Method Detail

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 unescapeSpaces)
Specified by:
decodeURL in interface Http

destroy

public void destroy()

encodeParameters

public String encodeParameters(String url)
Specified by:
encodeParameters in interface Http

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 hostConfiguration)

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
Deprecated. As of 6.1.0, replaced by getHostConfiguration(String)

Throws:
IOException

getHostConfiguration

public org.apache.commons.httpclient.HostConfiguration getHostConfiguration(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

getPath

public String getPath(String url)
Specified by:
getPath 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

isSecure

public boolean isSecure(String url)
Specified by:
isSecure 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,
                          int port,
                          boolean secure)
Specified by:
protocolize in interface Http

protocolize

public String protocolize(String url,
                          RenderRequest renderRequest)
Specified by:
protocolize in interface Http

proxifyState

public void proxifyState(org.apache.commons.httpclient.HttpState httpState,
                         org.apache.commons.httpclient.HostConfiguration hostConfiguration)

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

sanitizeHeader

public String sanitizeHeader(String header)
Specified by:
sanitizeHeader 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

shortenURL

public String shortenURL(String url,
                         int count)
Specified by:
shortenURL 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
Parameters:
url - the URL
Returns:
A string representation of the resource referenced by the URL object
Throws:
IOException - if an IO exception occurred

hasRequestHeader

protected boolean hasRequestHeader(org.apache.commons.httpclient.HttpMethod httpMethod,
                                   String name)

processPostMethod

protected void processPostMethod(org.apache.commons.httpclient.methods.PostMethod postMethod,
                                 List<Http.FilePart> fileParts,
                                 Map<String,String> parts)

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)

toCommonsFilePart

protected org.apache.commons.httpclient.methods.multipart.FilePart toCommonsFilePart(Http.FilePart filePart)

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,
                                List<Http.FilePart> fileParts,
                                Map<String,String> parts,
                                Http.Response response,
                                boolean followRedirects,
                                String progressId,
                                PortletRequest portletRequest)
                         throws IOException
Throws:
IOException

Liferay 6.2-ce-ga5