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
 HTTPResponse delete(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers)
           
 String encode(String str, String charset)
          translate a string in the URLEncoded Format
 HTTPResponse get(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers)
          make a http requst to given url
static HTTPUtil getInstance()
           
 HTTPResponse head(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers)
           
 HTTPResponse put(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers, Object body)
           
 HTTPResponse put(URL url, String username, String password, int timeout, String mimetype, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, Header[] headers, Object body)
           
 URI toURI(String strUrl)
           
 URI toURI(String strUrl, int port)
           
 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 HTTPResponse delete(URL url,
                           String username,
                           String password,
                           int timeout,
                           String charset,
                           String useragent,
                           String proxyserver,
                           int proxyport,
                           String proxyuser,
                           String proxypassword,
                           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, railo.commons.net.http.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 HTTPResponse head(URL url,
                         String username,
                         String password,
                         int timeout,
                         String charset,
                         String useragent,
                         String proxyserver,
                         int proxyport,
                         String proxyuser,
                         String proxypassword,
                         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, railo.commons.net.http.Header[])

get

public HTTPResponse get(URL url,
                        String username,
                        String password,
                        int timeout,
                        String charset,
                        String useragent,
                        String proxyserver,
                        int proxyport,
                        String proxyuser,
                        String proxypassword,
                        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:
HTTPUtil.get(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, railo.commons.net.http.Header[])

put

public HTTPResponse put(URL url,
                        String username,
                        String password,
                        int timeout,
                        String charset,
                        String useragent,
                        String proxyserver,
                        int proxyport,
                        String proxyuser,
                        String proxypassword,
                        Header[] headers,
                        Object 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, railo.commons.net.http.Header[], java.lang.Object)

put

public HTTPResponse put(URL url,
                        String username,
                        String password,
                        int timeout,
                        String mimetype,
                        String charset,
                        String useragent,
                        String proxyserver,
                        int proxyport,
                        String proxyuser,
                        String proxypassword,
                        Header[] headers,
                        Object body)
                 throws IOException
Throws:
IOException

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)

toURI

public URI toURI(String strUrl)
          throws URISyntaxException
Specified by:
toURI in interface HTTPUtil
Throws:
URISyntaxException

toURI

public URI toURI(String strUrl,
                 int port)
          throws URISyntaxException
Specified by:
toURI in interface HTTPUtil
Throws:
URISyntaxException


Copyright © 2012 Railo