org.w3c.jwput
Class JWGet

java.lang.Object
  |
  +--org.w3c.jwput.JW
        |
        +--org.w3c.jwput.JWGet

public class JWGet
extends JW

Get files on the Web


Fields inherited from class org.w3c.jwput.JW
BANNER, etagsDB, in, jwprops, manager, password, prompt, quiet, ui, user, USER_AGENT, verbose, VERSION
 
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(java.util.Properties userprops)
          Constructor
 
Method Summary
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.
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
static void usage()
          Display the "Usage" message.
 
Methods inherited from class org.w3c.jwput.JW
check, createRequest, displayErrorMessage, displayMessage, getETag, getETagsDatabase, getManager, getPort, getPreferencesFile, getProperties, getUserProperties, notifyProgress, performRequest, performRequest, performRequest, removeEtag, saveEtag
 
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
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,
                            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

updateProperties

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

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)

main

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