Changeset 9217
- Timestamp:
- 2005-03-01T10:39:23+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r9093 r9217 124 124 String library_url_string, boolean debug_enabled, String perl_path, 125 125 boolean no_load, String open_collection, 126 String site_name, String servlet_path, 127 String wget_version_str, String wget_path) 126 String site_name, String servlet_path, String wget_path) 128 127 { 129 128 if (gsdl3_path != null && !gsdl3_path.equals("")) { … … 247 246 } 248 247 249 // also check for wget250 248 boolean download_workflow = Configuration.get("workflow.download", false); 251 249 if (download_workflow) { 252 wget_version_str = StaticStrings.NO_WGET_STR; 253 // has the user specified a path? 254 if (wget_path != null && !wget_path.equals("")) { 255 File wget_file = new File(wget_path); 250 // If the WGet path hasn't been specified by the user, try the Greenstone one 251 if (wget_path == null) { 252 File wget_file = new File(Utility.getWGetPath(gsdl_path)); 256 253 if (wget_file.exists()) { 257 // we assume its ok if its there 258 wget_version_str = StaticStrings.WGET_STR; 259 } 260 } 261 262 // it hasn't been set by the user so we use the greenstone one 263 if (wget_version_str.equals(StaticStrings.NO_WGET_STR)) { 264 // TODO fix for gs3 265 wget_path = Utility.getWGetPath(gsdl_path); 266 File wget_file = new File(wget_path); 267 if (!wget_file.exists()) { 268 // we give up trying to find one 269 missingWGET(); 270 } else { 271 // we have found one 272 wget_version_str = StaticStrings.WGET_STR; 254 wget_path = Utility.getWGetPath(gsdl_path); 273 255 } 274 } 275 276 if (wget_version_str.equals(StaticStrings.WGET_STR)) { 277 // we have found one, should we check the version?? 256 } 257 258 // If we still don't have a WGet path, give up (there isn't anything else we can do) 259 String wget_version_str = null; 260 if (wget_path == null) { 261 wget_version_str = StaticStrings.NO_WGET_STR; 262 missingWGET(); 263 } 264 // Otherwise check the version of WGet 265 else { 278 266 wget_version_str = testWGetVersion(wget_path); 279 267 if (wget_version_str.equals(StaticStrings.WGET_OLD_STR)) { … … 281 269 } 282 270 } 283 284 // tell the config the new values 271 272 // Store the new values in the configuration 273 DebugStream.println("WGet path: " + wget_path); 285 274 Configuration.setWGetPath(wget_path); 286 275 Configuration.setWGetVersion(wget_version_str); … … 591 580 dialog.dispose(); 592 581 dialog = null; 593 }582 } 594 583 595 584 /** Prints a warning message about a missing PERL path, which although not fatal pretty much ensures no collection creation/building will work properly in the Gatherer. */ -
trunk/gli/src/org/greenstone/gatherer/GathererApplet.java
r9202 r9217 169 169 go.library_url_string, go.debug, go.perl_path, 170 170 go.no_load, go.filename, go.site_name, 171 go.servlet_path, go.wget_ version_str, go.wget_path);171 go.servlet_path, go.wget_path); 172 172 173 173 JButton bttn = new JButton("Launch Greenstone Librarian Interface ..."); -
trunk/gli/src/org/greenstone/gatherer/GathererProg.java
r9092 r9217 103 103 go.library_url_string, go.debug, go.perl_path, 104 104 go.no_load, go.filename, go.site_name, 105 go.servlet_path, go.wget_ version_str, go.wget_path);105 go.servlet_path, go.wget_path); 106 106 gatherer.run(size, g_man); 107 107 -
trunk/gli/src/org/greenstone/gatherer/GetOpt.java
r9055 r9217 49 49 public String servlet_path = null; 50 50 public String wget_path = null; 51 public String wget_version_str = StaticStrings.NO_WGET_STR; 51 52 52 53 53 public GetOpt(String[] args) … … 193 193 library_url_string = argument_value; 194 194 } 195 // Parse the path to PERL. If not provided it sassumes195 // Parse the path to PERL. If not provided it assumes 196 196 // perl should be availble on the PATH. 197 197 else if(argument_name.equals(StaticStrings.PERL_ARGUMENT)) { … … 213 213 perl_file = null; 214 214 } 215 // Otherwise its fine as it is 216 } 217 // Test for the presence of a WGet version. This is 218 // only useful if the user has enabled mirroring. Note 219 // that mirroring can be enabled by running the GLI 220 // with -mirror, editing the config.xml for GLI, or 221 // through a new option on the connections page of the 222 // preferences. 223 else if(argument_name.equals(StaticStrings.WGET_ARGUMENT)) { 224 if(argument_value.startsWith(StaticStrings.WGET_STR)) { 225 wget_version_str = StaticStrings.WGET_STR; 226 wget_path = argument_value.substring(StaticStrings.WGET_STR.length()); 227 } 228 else if(argument_value.startsWith(StaticStrings.WGET_OLD_STR)) { 229 wget_version_str = StaticStrings.WGET_OLD_STR; 230 wget_path = argument_value.substring(StaticStrings.WGET_OLD_STR.length()); 215 // Otherwise it is fine as it is 216 } 217 // Parse the path to WGet 218 else if (argument_name.equals(StaticStrings.WGET_ARGUMENT)) { 219 // Check the specified WGet file exists 220 if (argument_value != null && !argument_value.equals("")) { 221 File wget_file = new File(argument_value); 222 if (wget_file.exists()) { 223 wget_path = argument_value; 224 } 231 225 } 232 226 } -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r9209 r9217 900 900 901 901 /** returns the path to the greenstone version of wget */ 902 static public String getWGetPath(String gsdl_path) { 902 static public String getWGetPath(String gsdl_path) 903 { 903 904 if (isWindows()) { 904 return gsdl_path + "bin" + File.separator + 905 "windows" + File.separator +"wget.exe"; 906 } 907 // is it the same for macs?? 908 return gsdl_path + "bin" + File.separator + 909 "linux" + File.separator + "wget"; 905 return gsdl_path + "bin" + File.separator + "windows" + File.separator + "wget.exe"; 906 } 907 else if (isMac()) { 908 return gsdl_path + "bin" + File.separator + "darwin" + File.separator + "wget"; 909 } 910 else { 911 return gsdl_path + "bin" + File.separator + "linux" + File.separator + "wget"; 912 } 910 913 } 911 914
Note:
See TracChangeset
for help on using the changeset viewer.