org.w3c.jwput
Class JWGet

java.lang.Object
  |
  +--org.w3c.jwput.JW
        |
        +--org.w3c.jwput.JWGet
All Implemented Interfaces:
JWOptions, org.w3c.www.protocol.http.RequestObserver

public class JWGet
extends JW

Get files on the Web


Fields inherited from class org.w3c.jwput.JW
aborted, BANNER, DEFAULT_MIME, done, etagsDB, in, jwprops, listeners, manager, password, ppassword, prompt, puser, quiet, request, ui, uriInfos, user, USER_AGENT, verbose, VERSION, WINIE_DOC_URL, WINIE_LATEST_ZIP, 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
JWGet(org.w3c.www.protocol.http.HttpManager manager)
          Constructor
JWGet(org.w3c.www.protocol.http.HttpManager manager, JWUI ui)
          Constructor
JWGet(JWUI ui, java.util.Properties userprops)
          Constructor
JWGet(JWUI ui, java.util.Properties userprops, boolean loadpref)
          Constructor
JWGet(java.util.Properties userprops)
          Constructor
 
Method Summary
 void abort()
           
static void badArgs(java.lang.String msg)
          Display the message for bad command line error.
 void get(java.io.File toget, java.lang.String furl, boolean backup)
          Get the latest version of the remote file.
protected  java.io.File getBackupFile(java.io.File file)
          Get the backup file relative to the given file.
 java.io.File getFile(java.io.File toget, java.lang.String furl, boolean backup)
          Get the latest version of the remote file.
 java.io.File getFile(java.io.File toget, java.lang.String furl, boolean backup, boolean trace, org.w3c.www.http.HttpRange range, java.util.Hashtable headers)
          Get the latest version of the remote file.
 java.io.File getFile(java.io.File toget, java.lang.String furl, boolean backup, java.util.Hashtable headers)
          Get the latest version of the remote file.
 java.io.File getFile(java.io.File toget, java.lang.String furl, java.util.Hashtable headers)
          Get the latest version of the remote file.
static java.lang.String getFileName(java.lang.String url)
           
static java.lang.String getIdxFileName(java.lang.String url)
           
protected  void initialize(java.util.Properties props)
           
static void main(java.lang.String[] args)
           
 void updateProperties(java.util.Properties props)
          Update the user properties
 void upgradeWinie()
          Get the latest Winie distribution URL.
static void usage()
          Display the "Usage" message.
 
Methods inherited from class org.w3c.jwput.JW
addJWListener, check, createRequest, displayErrorMessage, displayErrorMessage, displayMessage, fireDownloadEvent, fireUploadEvent, getETag, getETagsDatabase, getManager, getPathConfig, getPort, getPreferences, getPreferencesFile, getProperties, getUserProperties, isAborted, isAbortedOrDone, isDone, notifyProgress, performRequest, performRequest, performRequest, performRequest, removeEtag, removeJWListener, saveEtag, savePreferences, setAborted, setDone, skipBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWGet

public JWGet(org.w3c.www.protocol.http.HttpManager manager)
Constructor
Parameters:
manager - the HttpManager to use

JWGet

public JWGet(org.w3c.www.protocol.http.HttpManager manager,
             JWUI ui)
Constructor
Parameters:
manager - the HttpManager to use
ui - the User Interface to use
See Also:
JWGUI, JWTUI

JWGet

public JWGet(java.util.Properties userprops)
Constructor
Parameters:
userprops - the Properties to use

JWGet

public JWGet(JWUI ui,
             java.util.Properties userprops)
Constructor
Parameters:
ui - the User Interface to use
userprops - the Properties to use
See Also:
JWGUI, JWTUI

JWGet

public JWGet(JWUI ui,
             java.util.Properties userprops,
             boolean loadpref)
Constructor
Parameters:
ui - the User Interface to use
loadpref - do we need to load preferences from disk?
userprops - the Properties to use
See Also:
JWGUI, JWTUI
Method Detail

getBackupFile

protected java.io.File getBackupFile(java.io.File file)
Get the backup file relative to the given file.
Parameters:
the - file to backup
Returns:
the backup file

get

public void get(java.io.File toget,
                java.lang.String furl,
                boolean backup)
         throws java.io.IOException
Get the latest version of the remote file. (and retry if connection is closed). display the banner.
Parameters:
toget - the file to update
furl - the URL
backup - if true the local file will be backuped

getFile

public java.io.File getFile(java.io.File toget,
                            java.lang.String furl,
                            boolean backup)
                     throws java.io.IOException
Get the latest version of the remote file. (and retry if connection is closed).
Parameters:
toget - the file to update
furl - the URL
backup - if true the local file will be backuped

getFile

public java.io.File getFile(java.io.File toget,
                            java.lang.String furl,
                            java.util.Hashtable headers)
                     throws java.io.IOException
Get the latest version of the remote file. (and retry if connection is closed).
Parameters:
toget - the file to update
furl - the URL

getFile

public java.io.File getFile(java.io.File toget,
                            java.lang.String furl,
                            boolean backup,
                            java.util.Hashtable headers)
                     throws java.io.IOException
Get the latest version of the remote file. (and retry if connection is closed).
Parameters:
toget - the file to update
furl - the URL
backup - if true the local file will be backuped

getFile

public java.io.File getFile(java.io.File toget,
                            java.lang.String furl,
                            boolean backup,
                            boolean trace,
                            org.w3c.www.http.HttpRange range,
                            java.util.Hashtable headers)
                     throws java.io.IOException
Get the latest version of the remote file. (no retry)
Parameters:
toget - the file to update
furl - the URL
backup - if true the local file will be backuped
trace - should we display trace?
range - the HttpRange to request

abort

public void abort()
Overrides:
abort in class JW

updateProperties

public void updateProperties(java.util.Properties props)
Update the user properties
Overrides:
updateProperties in class JW
Parameters:
props - the new peoperties

initialize

protected void initialize(java.util.Properties props)
Overrides:
initialize in class JW

usage

public static void usage()
Display the "Usage" message.

badArgs

public static void badArgs(java.lang.String msg)
Display the message for bad command line error.
Parameters:
msg - a message.

getIdxFileName

public static java.lang.String getIdxFileName(java.lang.String url)

getFileName

public static java.lang.String getFileName(java.lang.String url)

upgradeWinie

public void upgradeWinie()
Get the latest Winie distribution URL. This method display an error message if needed.
Returns:
the URL (a String) or null.

main

public static void main(java.lang.String[] args)