|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.w3c.jwput.JW
JW allows the user to perform HTTP requests
Field Summary | |
static java.lang.String |
BANNER
BANNER |
protected ETagsDatabase |
etagsDB
|
protected java.io.LineNumberReader |
in
|
protected java.util.Properties |
jwprops
|
protected org.w3c.www.protocol.http.HttpManager |
manager
|
protected java.lang.String |
password
|
protected boolean |
prompt
|
protected boolean |
quiet
|
protected JWUI |
ui
|
protected java.lang.String |
user
|
static java.lang.String |
USER_AGENT
USER_AGENT HEADER |
protected boolean |
verbose
|
static java.lang.String |
VERSION
Software version |
Constructor Summary | |
JW()
|
Method Summary | |
static void |
check(java.io.File file)
Check if the directory containing this file exists, if not create it. |
protected org.w3c.www.protocol.http.Request |
createRequest(java.util.Hashtable headers)
Create a HTTP Request using the given headers. |
protected void |
displayErrorMessage(org.w3c.www.protocol.http.Reply reply)
Display the error reply (including the body). |
protected void |
displayMessage(org.w3c.www.protocol.http.Reply reply)
Display the reply (including the body). |
java.lang.String |
getETag(java.io.File file,
java.lang.String url)
|
protected ETagsDatabase |
getETagsDatabase()
|
org.w3c.www.protocol.http.HttpManager |
getManager(java.util.Properties props)
Get the HttpManager. |
static int |
getPort(java.net.URL url)
Get the port number included in this URL. |
static java.io.File |
getPreferencesFile()
Get the preferences file |
java.util.Properties |
getProperties()
Get the General Properties. |
java.util.Properties |
getUserProperties()
Get the User Properties. |
protected void |
initialize(java.util.Properties props)
|
void |
notifyProgress(org.w3c.www.protocol.http.RequestEvent event)
Request Observer |
org.w3c.www.protocol.http.Reply |
performRequest(java.lang.String method,
java.lang.String url)
Perform a HTTP/1.1 Request, handle authorization and redirection automaticaly. |
org.w3c.www.protocol.http.Reply |
performRequest(java.lang.String method,
java.lang.String url,
java.util.Hashtable headers)
Perform a HTTP/1.1 Request, handle authorization and redirection automaticaly. |
org.w3c.www.protocol.http.Reply |
performRequest(java.lang.String method,
java.lang.String url,
java.io.InputStream body,
java.util.Hashtable headers)
Perform a HTTP/1.1 Request, handle authorization and redirection automaticaly. |
protected void |
removeEtag(java.io.File file,
java.lang.String url)
|
protected void |
saveEtag(java.io.File file,
java.lang.String url,
java.lang.String etag)
|
protected void |
skipBody(org.w3c.www.protocol.http.Reply reply)
Should be called to purge the reply, otherwise the connection won't be marked idle and won't be reused. |
void |
updateProperties(java.util.Properties props)
Update the user properties |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String USER_AGENT
public static final java.lang.String BANNER
public static final java.lang.String VERSION
protected JWUI ui
protected org.w3c.www.protocol.http.HttpManager manager
protected ETagsDatabase etagsDB
protected boolean verbose
protected boolean prompt
protected boolean quiet
protected java.io.LineNumberReader in
protected java.lang.String user
protected java.lang.String password
protected java.util.Properties jwprops
Constructor Detail |
public JW()
Method Detail |
protected ETagsDatabase getETagsDatabase()
public java.lang.String getETag(java.io.File file, java.lang.String url)
protected void saveEtag(java.io.File file, java.lang.String url, java.lang.String etag)
protected void removeEtag(java.io.File file, java.lang.String url)
public org.w3c.www.protocol.http.HttpManager getManager(java.util.Properties props)
props
- the propertiespublic void notifyProgress(org.w3c.www.protocol.http.RequestEvent event)
public static int getPort(java.net.URL url)
protected void displayErrorMessage(org.w3c.www.protocol.http.Reply reply)
reply
- the HTTP replyprotected void displayMessage(org.w3c.www.protocol.http.Reply reply)
reply
- the HTTP replyprotected org.w3c.www.protocol.http.Request createRequest(java.util.Hashtable headers)
headers
- a Hastable containing HTTP headersprotected void skipBody(org.w3c.www.protocol.http.Reply reply)
reply
- the reply to purge.public org.w3c.www.protocol.http.Reply performRequest(java.lang.String method, java.lang.String url)
method
- the HTTP Method (HEAD, GET, PUT, TRACE, ...)url
- the destination urlpublic org.w3c.www.protocol.http.Reply performRequest(java.lang.String method, java.lang.String url, java.util.Hashtable headers)
method
- the HTTP Method (HEAD, GET, PUT, TRACE, ...)url
- the destination urlheaders
- HTTP headerspublic org.w3c.www.protocol.http.Reply performRequest(java.lang.String method, java.lang.String url, java.io.InputStream body, java.util.Hashtable headers)
method
- the HTTP Method (HEAD, GET, PUT, TRACE, ...)url
- the destination urlbody
- an inputStream (null if there is no body in the request)headers
- HTTP headerspublic java.util.Properties getProperties()
public java.util.Properties getUserProperties()
public void updateProperties(java.util.Properties props)
props
- the new peopertiesprotected void initialize(java.util.Properties props)
public static void check(java.io.File file)
file
- the filepublic static java.io.File getPreferencesFile()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |