com.edsdev.jconvert.util
Class Http

java.lang.Object
  extended bycom.edsdev.jconvert.util.Http

public class Http
extends java.lang.Object


Constructor Summary
Http()
           
 
Method Summary
static java.net.URLConnection getPage(java.lang.String urlToGet)
          Simplest request, load a URL, no cookie, no referer, follow redirects blindly.
static java.net.URLConnection getPage(java.lang.String urlToGet, java.lang.String cookie, java.lang.String referer, boolean redirect)
           
static ByteBuffer getURL(java.net.URL dataURL)
           
static ByteBuffer getURL(java.net.URL dataURL, java.lang.String inCookie)
          Retrieve data from HTTP in raw byte form.
static java.net.URLConnection makeRequest(java.net.URL source, java.lang.String cookie)
           
static java.net.URLConnection postFormPage(java.lang.String urlToPost, java.lang.String cgiData, java.lang.String cookie, java.lang.String referer, boolean follow_redirects)
           
static ByteBuffer receiveData(java.net.URLConnection uc)
          Retrieve raw data from an already existing URL connection.
static java.lang.StringBuffer receivePage_old(java.net.URLConnection uc)
           
static java.lang.StringBuffer receivePage(java.net.URLConnection uc)
           
static java.lang.StringBuffer receivePage(java.net.URLConnection uc, java.lang.String charEncoding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Http

public Http()
Method Detail

postFormPage

public static java.net.URLConnection postFormPage(java.lang.String urlToPost,
                                                  java.lang.String cgiData,
                                                  java.lang.String cookie,
                                                  java.lang.String referer,
                                                  boolean follow_redirects)

makeRequest

public static java.net.URLConnection makeRequest(java.net.URL source,
                                                 java.lang.String cookie)
                                          throws java.io.IOException
Throws:
java.io.IOException

getURL

public static ByteBuffer getURL(java.net.URL dataURL)

getURL

public static ByteBuffer getURL(java.net.URL dataURL,
                                java.lang.String inCookie)
Retrieve data from HTTP in raw byte form.

Parameters:
dataURL - - The URL of the raw data to retrieve.
inCookie - - Any cookie needed to be passed along.
Returns:
- A result with raw data and the length.

receiveData

public static ByteBuffer receiveData(java.net.URLConnection uc)
                              throws java.io.IOException
Retrieve raw data from an already existing URL connection.

Parameters:
uc - - The URLConnection to pull the data from.
Returns:
- A structure containing the raw data and the length.
Throws:
java.io.IOException

receivePage

public static java.lang.StringBuffer receivePage(java.net.URLConnection uc,
                                                 java.lang.String charEncoding)
                                          throws java.io.IOException
Throws:
java.io.IOException

receivePage

public static java.lang.StringBuffer receivePage(java.net.URLConnection uc)
                                          throws java.io.IOException
Throws:
java.io.IOException

receivePage_old

public static java.lang.StringBuffer receivePage_old(java.net.URLConnection uc)
                                              throws java.io.IOException
Throws:
java.io.IOException

getPage

public static java.net.URLConnection getPage(java.lang.String urlToGet)
Simplest request, load a URL, no cookie, no referer, follow redirects blindly.

Parameters:
urlToGet - - The URL to load.
Returns:
- A URLConnection usable to retrieve the page requested.

getPage

public static java.net.URLConnection getPage(java.lang.String urlToGet,
                                             java.lang.String cookie,
                                             java.lang.String referer,
                                             boolean redirect)


JConvert - opensource project by Ed Sarrazin