Changeset 6786 for trunk/gli/src/org/greenstone/gatherer/file
- Timestamp:
- 2004-02-12T14:54:48+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java
r6748 r6786 34 34 import org.greenstone.gatherer.gui.PreviewCommandDialog; 35 35 import org.greenstone.gatherer.msm.MSMUtils; 36 import org.greenstone.gatherer.util.ExternalProgram; 36 37 import org.greenstone.gatherer.util.StaticStrings; 37 38 import org.greenstone.gatherer.util.Utility; … … 118 119 } else { 119 120 // we try to look for a browser 121 String [] browsers = new String [] {"mozilla", "netscape"}; 122 for (int i=0; i<browsers.length; i++) { 123 if (isAvailable(browsers[i])) { 124 command = browsers[i]+ " %1"; 125 break; 126 } 127 } 120 128 } 121 129 … … 303 311 return entries.getLength(); 304 312 } 313 314 315 protected boolean isAvailable(String program) { 316 try { 317 ExternalProgram e = new ExternalProgram("which", program); 318 e.exitProgram(); 319 String out = e.getLineOfProgramOutput(); 320 if (out == null) { 321 return false; 322 } 323 return true; 324 } catch (Exception exc) { 325 return false; 326 } 327 } 305 328 }
Note:
See TracChangeset
for help on using the changeset viewer.