Changeset 33410

Show
Ignore:
Timestamp:
13.08.2019 21:48:19 (9 days ago)
Author:
ak19
Message:

Committing some variable name changes before I replace this file with the newer version that doesn't mirror sites with wget but gets WET files and unzips them instead.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/maori-lang-detection/src/org/greenstone/atea/NZTLDProcessor.java

    r33405 r33410  
    2828 
    2929    private final ExtractableTextFileFilter extractableTxtFilesFilter = new ExtractableTextFileFilter();     
    30     private final String sitesDir = "../dwn-sites"; 
     30    private final String SITES_DIR = "../dwn-sites"; 
    3131 
    3232    private void log(String msg) { 
     
    116116    log("Processing seed URL: " + nzDomainURL); 
    117117 
    118     //if(wgetURL(nzDomainURL)) { 
    119     if(!DEBUG_MODE) { wgetURL(nzDomainURL); } // TODO: take out debug_mode condition 
     118    //if(wgetMirrorSite(nzDomainURL)) { 
     119    if(!DEBUG_MODE) { wgetMirrorSite(nzDomainURL); } // TODO: take out debug_mode condition 
    120120     
    121121    processDownloadedDir(nzDomainURL); 
     
    125125    } 
    126126 
    127     // wget will be launched from the specified directory, ../dwn_sites 
     127    // wget will be launched from the specified directory, SITES_DIR 
    128128    // Wget exit status/return codes: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html 
    129     public boolean wgetURL(String nzDomainURL) { 
     129    public boolean wgetMirrorSite(String nzDomainURL) { 
    130130    // use SafeProcess and wget command in lib/config.properties 
    131131    // DONE: set up logging 
    132132 
    133133     
    134     String wgetCmd = configProps.getProperty("wget.cmd"); 
     134    String wgetCmd = configProps.getProperty("wget.mirror.cmd"); 
    135135    if(wgetCmd == null || wgetCmd.equals("")) { 
    136         System.err.println("Invalid or empty wget.cmd in config.properties"); 
     136        System.err.println("Invalid or empty wget.mirror.cmd in config.properties"); 
    137137        return false; 
    138138    } 
     
    144144 
    145145    String[] wgetCommandArgs = wgetCmd.split(" "); 
    146     SafeProcess wgetProcess = new SafeProcess(wgetCommandArgs, null, new File(sitesDir)); 
     146    SafeProcess wgetProcess = new SafeProcess(wgetCommandArgs, null, new File(SITES_DIR)); 
    147147     
    148148    SafeProcess.LineByLineHandler outLineHandler = new ProcessLineHandler(logger, SafeProcess.STDOUT); 
     
    194194    // recurse through the downloaded directory, then process each file 
    195195 
    196     File downloadedSiteDir = new File(sitesDir, nzDomainURL); 
     196    File downloadedSiteDir = new File(SITES_DIR, nzDomainURL); 
    197197    log("*** Will process download dir " + downloadedSiteDir); 
    198198     
     
    238238    // recurse through the downloaded directory, then process each file 
    239239 
    240     File downloadedSiteDir = new File(sitesDir, nzDomainURL); 
     240    File downloadedSiteDir = new File(SITES_DIR, nzDomainURL); 
    241241    if(!downloadedSiteDir.exists()) { 
    242242        error("*** Expected downloaded site " + downloadedSiteDir + ", but it did not exist!");