Changeset 31646 for main/trunk/gli/src/org/greenstone/gatherer/file
- Timestamp:
- 2017-05-04T20:32:17+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java
r31637 r31646 117 117 String [] browsers = new String [] {"mozilla", "netscape", "firefox"}; 118 118 for (int i=0; i<browsers.length; i++) { 119 if ( isAvailable(browsers[i])) {119 if (SafeProcess.isAvailable(browsers[i])) { 120 120 command = browsers[i]+ " %1"; 121 121 break; … … 351 351 } 352 352 353 354 protected boolean isAvailable(String program) {355 try {356 // `which bla` does nothing, prompt is returned357 // `which grep` returns a line of output with the path to grep358 SafeProcess prcs = new SafeProcess("which " + program);359 prcs.runProcess();360 String output = prcs.getStdOutput();361 if(output.equals("")) {362 return false;363 }364 //System.err.println("*** 'which " + program + "' returned: " + output);365 return true;366 } catch (Exception exc) {367 return false;368 }369 }370 353 }
Note:
See TracChangeset
for help on using the changeset viewer.