railo.runtime.util
Class HTTPUtilImpl

java.lang.Object
  extended by railo.runtime.util.HTTPUtilImpl
All Implemented Interfaces:
HTTPUtil

public class HTTPUtilImpl
extends Object
implements HTTPUtil


Field Summary
 
Fields inherited from interface railo.runtime.util.HTTPUtil
ACTION_GET, ACTION_POST, STATUS_OK
 
Method Summary
 String decode(String str, String charset)
          translate a url encoded string to a regular string
 org.apache.commons.httpclient.HttpMethod delete(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers)
           
 String encode(String str, String charset)
          translate a string in the URLEncoded Format
 org.apache.commons.httpclient.HttpMethod get(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers)
          make a http requst to given url
static HTTPUtil getInstance()
           
 org.apache.commons.httpclient.HttpMethod head(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers)
           
 org.apache.commons.httpclient.HttpMethod put(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers, org.apache.commons.httpclient.methods.RequestEntity body)
           
 org.apache.commons.httpclient.methods.RequestEntity toRequestEntity(Object value)
           
 Object toURL(org.apache.commons.httpclient.HttpMethod httpMethod)
           
 URL toURL(String strUrl)
          cast a string to a url
 URL toURL(String strUrl, int port)
          cast a string to a url
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static HTTPUtil getInstance()

decode

public String decode(String str,
                     String charset)
              throws UnsupportedEncodingException
Description copied from interface: HTTPUtil
translate a url encoded string to a regular string

Specified by:
decode in interface HTTPUtil
Parameters:
str - encoded string
charset - charset used
Returns:
raw string
Throws:
UnsupportedEncodingException
See Also:
HTTPUtil.decode(java.lang.String, java.lang.String)

delete

public org.apache.commons.httpclient.HttpMethod delete(URL url,
                                                       String username,
                                                       String password,
                                                       int timeout,
                                                       String charset,
                                                       String useragent,
                                                       String proxyserver,
                                                       int proxyport,
                                                       String proxyuser,
                                                       String proxypassword,
                                                       org.apache.commons.httpclient.Header[] headers)
                                                throws IOException
Specified by:
delete in interface HTTPUtil
Throws:
IOException
See Also:
HTTPUtil.delete(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, org.apache.commons.httpclient.Header[])

encode

public String encode(String str,
                     String charset)
              throws UnsupportedEncodingException
Description copied from interface: HTTPUtil
translate a string in the URLEncoded Format

Specified by:
encode in interface HTTPUtil
Parameters:
str -
charset -
Returns:
Throws:
UnsupportedEncodingException

head

public org.apache.commons.httpclient.HttpMethod head(URL url,
                                                     String username,
                                                     String password,
                                                     int timeout,
                                                     String charset,
                                                     String useragent,
                                                     String proxyserver,
                                                     int proxyport,
                                                     String proxyuser,
                                                     String proxypassword,
                                                     org.apache.commons.httpclient.Header[] headers)
                                              throws IOException
Specified by:
head in interface HTTPUtil
Throws:
IOException
See Also:
HTTPUtil.head(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, org.apache.commons.httpclient.Header[])

get

public org.apache.commons.httpclient.HttpMethod get(URL url,
                                                    String username,
                                                    String password,
                                                    int timeout,
                                                    String charset,
                                                    String useragent,
                                                    String proxyserver,
                                                    int proxyport,
                                                    String proxyuser,
                                                    String proxypassword,
                                                    org.apache.commons.httpclient.Header[] headers)
                                             throws IOException
Description copied from interface: HTTPUtil
make a http requst to given url

Specified by:
get in interface HTTPUtil
Returns:
resulting inputstream
Throws:
IOException
See Also:
railo.commons.net.HTTPUtil#invoke(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, org.apache.commons.httpclient.Header[])

put

public org.apache.commons.httpclient.HttpMethod put(URL url,
                                                    String username,
                                                    String password,
                                                    int timeout,
                                                    String charset,
                                                    String useragent,
                                                    String proxyserver,
                                                    int proxyport,
                                                    String proxyuser,
                                                    String proxypassword,
                                                    org.apache.commons.httpclient.Header[] headers,
                                                    org.apache.commons.httpclient.methods.RequestEntity body)
                                             throws IOException
Specified by:
put in interface HTTPUtil
Throws:
IOException
See Also:
HTTPUtil.put(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, org.apache.commons.httpclient.Header[], org.apache.commons.httpclient.methods.RequestEntity)

toRequestEntity

public org.apache.commons.httpclient.methods.RequestEntity toRequestEntity(Object value)
                                                                    throws PageException
Specified by:
toRequestEntity in interface HTTPUtil
Throws:
PageException
See Also:
HTTPUtil.toRequestEntity(java.lang.Object)

toURL

public URL toURL(String strUrl,
                 int port)
          throws MalformedURLException
Description copied from interface: HTTPUtil
cast a string to a url

Specified by:
toURL in interface HTTPUtil
Parameters:
strUrl - string represent a url
Returns:
url from string
Throws:
MalformedURLException
See Also:
HTTPUtil.toURL(java.lang.String, int)

toURL

public URL toURL(String strUrl)
          throws MalformedURLException
Description copied from interface: HTTPUtil
cast a string to a url

Specified by:
toURL in interface HTTPUtil
Parameters:
strUrl - string represent a url
Returns:
url from string
Throws:
MalformedURLException
See Also:
HTTPUtil.toURL(java.lang.String)

toURL

public Object toURL(org.apache.commons.httpclient.HttpMethod httpMethod)
Specified by:
toURL in interface HTTPUtil
See Also:
HTTPUtil.toURL(org.apache.commons.httpclient.HttpMethod)


Copyright © 2012 Railo