Changeset 31637
- Timestamp:
- 2017-04-27T20:46:05+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java
r24709 r31637 35 35 import org.greenstone.gatherer.gui.FileAssociationDialog; 36 36 import org.greenstone.gatherer.gui.PreviewCommandDialog; 37 import org.greenstone.gatherer.util. ExternalProgram;37 import org.greenstone.gatherer.util.SafeProcess; 38 38 import org.greenstone.gatherer.util.StaticStrings; 39 39 import org.greenstone.gatherer.util.Utility; … … 115 115 } else { 116 116 // we try to look for a browser 117 String [] browsers = new String [] {"mozilla", "netscape" };117 String [] browsers = new String [] {"mozilla", "netscape", "firefox"}; 118 118 for (int i=0; i<browsers.length; i++) { 119 119 if (isAvailable(browsers[i])) { … … 354 354 protected boolean isAvailable(String program) { 355 355 try { 356 ExternalProgram e = new ExternalProgram("which", program); 357 e.exitProgram(); 358 String out = e.getLineOfProgramOutput(); 359 if (out == null) { 356 // `which bla` does nothing, prompt is returned 357 // `which grep` returns a line of output with the path to grep 358 SafeProcess prcs = new SafeProcess("which " + program); 359 prcs.runProcess(); 360 String output = prcs.getStdOutput(); 361 if(output.equals("")) { 360 362 return false; 361 363 } 364 //System.err.println("*** 'which " + program + "' returned: " + output); 362 365 return true; 363 366 } catch (Exception exc) {
Note:
See TracChangeset
for help on using the changeset viewer.