|
|||||||||
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 | |
protected boolean |
aborted
|
static java.lang.String |
BANNER
BANNER |
static java.lang.String |
DEFAULT_MIME
Default mime type |
protected boolean |
done
|
protected ETagsDatabase |
etagsDB
|
protected java.io.LineNumberReader |
in
|
protected java.util.Properties |
jwprops
|
protected java.util.Vector |
listeners
|
protected org.w3c.www.protocol.http.HttpManager |
manager
|
protected java.lang.String |
password
|
protected java.lang.String |
ppassword
|
protected boolean |
prompt
|
protected java.lang.String |
puser
|
protected boolean |
quiet
|
protected org.w3c.www.protocol.http.Request |
request
|
protected JWUI |
ui
|
protected java.util.Hashtable |
uriInfos
|
protected java.lang.String |
user
|
static java.lang.String |
USER_AGENT
USER_AGENT HEADER |
protected boolean |
verbose
|
static java.lang.String |
VERSION
Software version |
static java.lang.String |
WINIE_DOC_URL
Documentation URL |
static java.lang.String |
WINIE_LATEST_ZIP
Latest distribution URL |
static java.lang.String |
WINIE_URL
Winie URL |
Fields inherited from interface org.w3c.jwput.JWOptions |
ACCEPT_LANGUAGE_P, BACKUP_P, DEF_TRIES, ETAGS_DB, FALSE_P, HEADER_PREFIX, HIDE_POPUPS_P, HOMEDIR_P, LOAD_DIR_P, MIME_PREFIX, MIMEDEF_P, OVERWRITE_P, PASSWORD_P, PROGRESS_BAR_P, PROMPT_P, PROXY_HOST_P, PROXY_PORT_P, PROXY_SET_P, PUT_CVS_P, QUIET_P, REC_P, SAVE_DIR_P, SOCKS_HOST_P, SOCKS_PORT_P, TRIES_P, TRUE_P, USER_AGENT_P, USER_P, VERBOSE_P, WPUTDIR, WPUTRC |
Constructor Summary | |
JW()
|
Method Summary | |
void |
abort()
|
void |
addJWListener(org.w3c.jwput.event.JWListener listener)
|
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 |
displayErrorMessage(org.w3c.www.protocol.http.Reply reply,
java.lang.String msg)
Display the error reply (including the body). |
protected void |
displayMessage(org.w3c.www.protocol.http.Reply reply)
Display the reply (including the body). |
protected void |
fireDownloadEvent(java.lang.String file,
java.lang.String url)
|
protected void |
fireUploadEvent(java.lang.String file,
java.lang.String url)
|
java.lang.String |
getETag(java.io.File file,
java.lang.String url)
|
protected ETagsDatabase |
getETagsDatabase()
|
static java.lang.String |
getFileName(java.lang.String path)
|
org.w3c.www.protocol.http.HttpManager |
getManager(java.util.Properties props)
Get the HttpManager. |
static java.io.File |
getPathConfig()
|
static int |
getPort(java.net.URL url)
Get the port number included in this URL. |
static org.w3c.util.XMLProperties |
getPreferences()
|
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)
|
protected boolean |
isAborted()
|
protected boolean |
isAbortedOrDone()
|
protected boolean |
isDone()
|
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. |
org.w3c.www.protocol.http.Reply |
performRequest(java.lang.String method,
java.lang.String url,
java.io.InputStream body,
java.util.Hashtable headers,
boolean follow)
Perform a HTTP/1.1 Request, handle authorization and redirection automaticaly. |
protected void |
removeEtag(java.io.File file,
java.lang.String url)
|
void |
removeJWListener(org.w3c.jwput.event.JWListener listener)
|
protected void |
saveEtag(java.io.File file,
java.lang.String url,
java.lang.String etag)
|
static void |
savePreferences(java.util.Properties prefs)
|
protected void |
setAborted(boolean aborted)
|
protected void |
setDone(boolean done)
|
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
public static final java.lang.String WINIE_LATEST_ZIP
public static final java.lang.String WINIE_DOC_URL
public static final java.lang.String WINIE_URL
public static final java.lang.String DEFAULT_MIME
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.lang.String puser
protected java.lang.String ppassword
protected java.util.Properties jwprops
protected java.util.Hashtable uriInfos
protected boolean done
protected boolean aborted
protected org.w3c.www.protocol.http.Request request
protected java.util.Vector listeners
Constructor Detail |
public JW()
Method Detail |
public void addJWListener(org.w3c.jwput.event.JWListener listener)
public void removeJWListener(org.w3c.jwput.event.JWListener listener)
protected void fireUploadEvent(java.lang.String file, java.lang.String url)
protected void fireDownloadEvent(java.lang.String file, java.lang.String url)
protected boolean isAbortedOrDone()
protected boolean isAborted()
protected boolean isDone()
protected void setAborted(boolean aborted)
protected void setDone(boolean done)
public void abort()
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)
notifyProgress
in interface org.w3c.www.protocol.http.RequestObserver
public static int getPort(java.net.URL url)
protected void displayErrorMessage(org.w3c.www.protocol.http.Reply reply)
reply
- the HTTP replyprotected void displayErrorMessage(org.w3c.www.protocol.http.Reply reply, java.lang.String msg)
reply
- the HTTP replymsg
- the message to displayprotected 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 org.w3c.www.protocol.http.Reply performRequest(java.lang.String method, java.lang.String url, java.io.InputStream body, java.util.Hashtable headers, boolean follow)
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 headersfollow
- follow redirections?public java.util.Properties getProperties()
public java.util.Properties getUserProperties()
public void updateProperties(java.util.Properties props)
props
- the new propertiesprotected void initialize(java.util.Properties props)
public static void check(java.io.File file)
file
- the filepublic static java.io.File getPathConfig()
public static java.io.File getPreferencesFile()
public static org.w3c.util.XMLProperties getPreferences() throws java.io.IOException, java.io.FileNotFoundException
public static void savePreferences(java.util.Properties prefs) throws java.io.IOException
public static java.lang.String getFileName(java.lang.String path)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |