Changeset 33410 for gs3-extensions
- Timestamp:
- 2019-08-13T21:48:19+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/maori-lang-detection/src/org/greenstone/atea/NZTLDProcessor.java
r33405 r33410 28 28 29 29 private final ExtractableTextFileFilter extractableTxtFilesFilter = new ExtractableTextFileFilter(); 30 private final String sitesDir= "../dwn-sites";30 private final String SITES_DIR = "../dwn-sites"; 31 31 32 32 private void log(String msg) { … … 116 116 log("Processing seed URL: " + nzDomainURL); 117 117 118 //if(wget URL(nzDomainURL)) {119 if(!DEBUG_MODE) { wget URL(nzDomainURL); } // TODO: take out debug_mode condition118 //if(wgetMirrorSite(nzDomainURL)) { 119 if(!DEBUG_MODE) { wgetMirrorSite(nzDomainURL); } // TODO: take out debug_mode condition 120 120 121 121 processDownloadedDir(nzDomainURL); … … 125 125 } 126 126 127 // wget will be launched from the specified directory, ../dwn_sites127 // wget will be launched from the specified directory, SITES_DIR 128 128 // Wget exit status/return codes: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html 129 public boolean wget URL(String nzDomainURL) {129 public boolean wgetMirrorSite(String nzDomainURL) { 130 130 // use SafeProcess and wget command in lib/config.properties 131 131 // DONE: set up logging 132 132 133 133 134 String wgetCmd = configProps.getProperty("wget. cmd");134 String wgetCmd = configProps.getProperty("wget.mirror.cmd"); 135 135 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"); 137 137 return false; 138 138 } … … 144 144 145 145 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)); 147 147 148 148 SafeProcess.LineByLineHandler outLineHandler = new ProcessLineHandler(logger, SafeProcess.STDOUT); … … 194 194 // recurse through the downloaded directory, then process each file 195 195 196 File downloadedSiteDir = new File( sitesDir, nzDomainURL);196 File downloadedSiteDir = new File(SITES_DIR, nzDomainURL); 197 197 log("*** Will process download dir " + downloadedSiteDir); 198 198 … … 238 238 // recurse through the downloaded directory, then process each file 239 239 240 File downloadedSiteDir = new File( sitesDir, nzDomainURL);240 File downloadedSiteDir = new File(SITES_DIR, nzDomainURL); 241 241 if(!downloadedSiteDir.exists()) { 242 242 error("*** Expected downloaded site " + downloadedSiteDir + ", but it did not exist!");
Note:
See TracChangeset
for help on using the changeset viewer.