|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.taglibs.scrape.HttpConnection
public class HttpConnection
HttpConnection - the class that creates the http connection that the rest of the package uses
Constructor Summary | |
---|---|
HttpConnection(java.net.URL url,
int port,
java.lang.String server,
java.lang.String authstring,
javax.servlet.jsp.PageContext pc)
constructor creates an instance of HttpConnection and calls the super class HttpURLConnection, this instance of the class connects through a proxy server that requires authentication |
|
HttpConnection(java.net.URL url,
PageData pd,
javax.servlet.jsp.PageContext pc)
constructor creates an instance of HttpConnection and calls the super class HttpURLConnection |
Method Summary | |
---|---|
void |
connect()
Implementation of the abstract method defined in the URLConnection class establish a connection to an HTTP server and send request |
void |
disconnect()
Implementation of the abstract method defined in the HttpURLConnection class cut the current connection this object has |
long |
getExpiration()
Override default provided in URLConnection |
java.lang.String |
getHeaderField(int n)
Override default provided in URLConnection |
java.lang.String |
getHeaderField(java.lang.String key)
Override default provided in URLConnection |
int |
getHeaderFieldInt(java.lang.String key,
int n)
Override default provided in URLConnection |
java.lang.String |
getHeaderFieldKey(int n)
Override default provided in URLConnection |
java.io.InputStream |
getInputStream()
Override the default method provided in the URLConnection class |
long |
getLastModified()
Override default provided in URLConnection |
java.io.OutputStream |
getOutputStream()
Override the default method provided in the URLConnection class |
java.lang.String |
getRequestMethod()
get the request method |
int |
getResponseCode()
Override the default method provided in the HttpURLConnection class Get the response code for this connection |
java.lang.String |
getResponseMessage()
Override the default method provided in the HttpURLConnection class Get the response message for the last request |
java.net.URL |
getURL()
get the URL of this connection |
void |
sendRequest()
send the request to the server |
void |
setRequestMethod(java.lang.String value)
set the request method |
protected void |
setURL(java.lang.String value)
Set the URL for this connection |
boolean |
usingProxy()
Implementation of the abstract method defined in the HttpURLConnection class this implementation does not use proxy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpConnection(java.net.URL url, PageData pd, javax.servlet.jsp.PageContext pc)
url
- - url of the http server to connect topublic HttpConnection(java.net.URL url, int port, java.lang.String server, java.lang.String authstring, javax.servlet.jsp.PageContext pc)
url
- url of the http server to connect toport
- the port to use for the connection to the proxy serverserver
- the proxy serversecure
- is the link going over httpsname
- user name for authenticationpass
- password for authenticationMethod Detail |
---|
public void connect() throws java.io.IOException
java.io.IOException
- - if connection cannot be madepublic void disconnect()
public boolean usingProxy()
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
public java.lang.String getRequestMethod()
public void setRequestMethod(java.lang.String value)
String
- GET or HEADpublic int getResponseCode()
public java.lang.String getResponseMessage()
public void sendRequest() throws java.io.IOException
java.io.IOException
public java.lang.String getHeaderField(int n)
n
- - index of the desired header fieldpublic long getLastModified()
public long getExpiration()
public java.lang.String getHeaderField(java.lang.String key)
key
- - name of the desired header fieldpublic int getHeaderFieldInt(java.lang.String key, int n)
n
- value returned if header is nullkey
- header to retreive
public java.lang.String getHeaderFieldKey(int n)
n
- - index of the desired header fieldprotected void setURL(java.lang.String value) throws java.net.MalformedURLException
java.net.MalformedURLException
public java.net.URL getURL()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |