Changeset 13026


Ignore:
Timestamp:
2006-10-06T09:44:45+13:00 (18 years ago)
Author:
mdewsnip
Message:

Removed all the old WGet stuff.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/Configuration.java

    r12054 r13026  
    126126    static private int cache_miss = 0;
    127127
    128     static private String wget_path = null;
    129     static private String wget_version_str = StaticStrings.NO_WGET_STR;
    130 
    131128    static public URL gliserver_url = null;
    132129    static public URL library_url = null;
     
    700697    static public String getGS3ScriptPath() {
    701698    return gsdl3_src_path + "bin" + File.separator + "script" + File.separator;
    702     }
    703 
    704     static public String getWGetPath() {
    705     return (wget_path != null ? wget_path : "");
    706     }
    707 
    708     static public String getWGetVersion() {
    709     return (wget_version_str != null ? wget_version_str : StaticStrings.NO_WGET_STR);
    710699    }
    711700
     
    956945    }
    957946
    958     static public void setWGetPath(String path) {
    959     wget_path  = path;
    960     }
    961 
    962     static public void setWGetVersion(String version) {
    963     wget_version_str = version;
    964     }
    965 
    966947    static private void updateUI() {
    967948    // Buttons
  • trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r13014 r13026  
    184184    init(go.gsdl_path, go.gsdl3_path, go.gsdl3_src_path, go.local_library_path, go.library_url_string,
    185185         go.gliserver_url_string, go.debug, go.perl_path, go.no_load, go.filename, go.site_name,
    186          go.servlet_path, go.wget_path);
     186         go.servlet_path);
    187187    }
    188188
     
    191191             String library_url_string, String gliserver_url_string, boolean debug_enabled,
    192192             String perl_path, boolean no_load, String open_collection,
    193              String site_name, String servlet_path, String wget_path)
     193             String site_name, String servlet_path)
    194194    {
    195195    if (gsdl3_path != null && !gsdl3_path.equals("")) {
     
    350350            missingPERL();
    351351        }
    352         }
    353 
    354         boolean download_workflow = Configuration.get("workflow.download", false);
    355         if (download_workflow) {
    356         // If the WGet path hasn't been specified by the user, try the Greenstone one
    357         if (wget_path == null) {
    358             String wget_file_path = gsdl_path + "bin" + File.separator;
    359             if (Utility.isWindows()) {
    360             wget_file_path += "windows" + File.separator + "wget.exe";
    361             }
    362             else if (Utility.isMac()) {
    363             wget_file_path += "darwin" + File.separator + "wget";
    364             }
    365             else {
    366             wget_file_path += "linux" + File.separator + "wget";
    367             }
    368             if (new File(wget_file_path).exists()) {
    369             wget_path = wget_file_path;
    370             }
    371         }
    372 
    373         // If we still don't have a WGet path, give up (there isn't anything else we can do)
    374         String wget_version_str = null;
    375         if (wget_path == null) {
    376             wget_version_str = StaticStrings.NO_WGET_STR;
    377             missingWGET();
    378         }
    379         // Otherwise check the version of WGet
    380         else {
    381             wget_version_str = testWGetVersion(wget_path);
    382             if (wget_version_str.equals(StaticStrings.WGET_OLD_STR)) {
    383             oldWGET();
    384             }
    385         }
    386 
    387         // Store the new values in the configuration
    388         DebugStream.println("WGet path: " + wget_path);
    389         Configuration.setWGetPath(wget_path);
    390         Configuration.setWGetVersion(wget_version_str);
    391352        }
    392353
     
    790751    static private void missingPERL() {
    791752    WarningDialog dialog = new WarningDialog("warning.MissingPERL", "MissingPERL.Title", Dictionary.get("MissingPERL.Message"), null, false);
    792     dialog.display();
    793     dialog.dispose();
    794     dialog = null;
    795     }
    796 
    797     /** Prints a warning message about missing a valid WGet path, which although not fatal means mirroring won't work */
    798     static public void missingWGET() {
    799     WarningDialog dialog = new WarningDialog("warning.MissingWGET", "MissingWGET.Title", Dictionary.get("MissingWGET.Message"), null, false);
    800     dialog.display();
    801     dialog.dispose();
    802     dialog = null;
    803     }
    804 
    805     /** Prints a warning message about having an old version of WGet. not fatal, but mirroring may not work properly */
    806     static public void oldWGET() {
    807     WarningDialog dialog = new WarningDialog("warning.OldWGET", "OldWGET.Title", Dictionary.get("OldWGET.Message"), null, false);
    808753    dialog.display();
    809754    dialog.dispose();
     
    837782    }
    838783
    839 
    840     // TODO fill this in
    841     private String testWGetVersion(String wget_path) {
    842     return StaticStrings.WGET_STR;
    843     }
    844784   
    845785    /** This private class contains an instance of an external application running within a JVM shell. It is important that this process sits in its own thread, but its more important that when we exit the Gatherer we don't actually System.exit(0) the Gatherer object until the user has volunteerily ended all of these child processes. Otherwise when we quit the Gatherer any changes the users may have made in external programs will be lost and the child processes are automatically deallocated. */
  • trunk/gli/src/org/greenstone/gatherer/GetOpt.java

    r13014 r13026  
    5252    public String site_name = null; // for GS3
    5353    public String servlet_path = null;
    54     public String wget_path = null;
    5554    public String metadata_path = null;
    5655
     
    230229            // Otherwise it is fine as it is
    231230            }
    232             // Parse the path to WGet
    233             else if (argument_name.equals(StaticStrings.WGET_ARGUMENT)) {
    234             // Check the specified WGet file exists
    235             if (argument_value != null && !argument_value.equals("")) {
    236                 File wget_file = new File(argument_value);
    237                 if (wget_file.exists()) {
    238                 wget_path = argument_value;
    239                 }
    240             }
    241             }
    242231                    else if(argument_name.equals(StaticStrings.METADATA_PATH)){
    243232            if (argument_value != null && !argument_value.equals("")) {
  • trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java

    r12802 r13026  
    375375        return;
    376376    }
    377     // Lets see what warning message we should display, if any.
    378     String wget_version_str = Configuration.getWGetVersion();
    379     if(wget_version_str.equals(StaticStrings.NO_WGET_STR)) {
    380         // If there was no WGet available then downloading is disabled entirely
    381         download_button_enabled = false;
    382         // And we tell the user why.
    383       Gatherer.missingWGET();
    384     }
    385     else if(wget_version_str.equals(StaticStrings.WGET_OLD_STR)) {
    386         // Downloading is enabled
    387         download_button_enabled = true;
    388         // But we display a preventable warning message about the path problems.
    389         Gatherer.oldWGET();
    390     }
    391     // Otherwise version must be ok
    392     else {
    393         download_button_enabled = true;
    394     }
     377
    395378    // It is also a good time to determine if the download should be enabled - ie if its allowed to be enabled and a valid URL is present in the field.
     379    download_button_enabled = true;
    396380    //download_button.setEnabled(download_button_enabled);
    397381    }
  • trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java

    r13014 r13026  
    160160    static final public String NEWLINE_CHARACTER = "\\";
    161161    static final public String NO_LOAD_ARGUMENT = "-no_load";
    162     static final public String NO_WGET_STR = "NoWGet";
    163162    static final public String ONE_CHARACTER = "1";
    164163    static final public String OPEN_PARENTHESIS_CHARACTER = "(";
     
    211210    static final public String VALUE_ATTRIBUTE = "value";
    212211    static final public String VERSION_ATTRIBUTE = "version";
    213     static final public String WGET_ARGUMENT = "-wget";
    214     static final public String WGET_OLD_STR = "<WGet1.9";
    215     static final public String WGET_STR = "WGet1.9";
    216212    static final public String WIN_9X_OPEN_COMMAND = "command.com /c start \"%1\"";
    217213    static final public String WIN_OPEN_COMMAND = "cmd.exe /c start \"\" \"%1\"";
Note: See TracChangeset for help on using the changeset viewer.