- Timestamp:
- 2017-05-31T18:05:11+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r31670 r31718 1456 1456 static private class ExternalApplication 1457 1457 extends Thread { 1458 private Process process = null;1458 private SafeProcess process = null; 1459 1459 /** The initial command string given to this sub-process. */ 1460 1460 private String command = null; … … 1515 1515 } 1516 1516 DebugStream.println("Running " + whole_command.toString()); 1517 Runtime rt = Runtime.getRuntime(); 1518 process = rt.exec(commands); 1519 process.waitFor(); 1517 process = new SafeProcess(commands); 1520 1518 } 1521 1519 else { 1522 1520 DebugStream.println("Running " + command); 1523 Runtime rt = Runtime.getRuntime(); 1524 process = rt.exec(command); 1525 process.waitFor(); 1526 } 1521 process = new SafeProcess(command); 1522 } 1523 process.runProcess(); 1527 1524 } 1528 1525 catch (Exception exception) { … … 1548 1545 public void stopExternalApplication() { 1549 1546 if(process != null) { 1550 process.destroy(); 1547 SafeProcess.log("*** stopExternalApplication called."); 1548 process.cancelRunningProcess(); 1551 1549 } 1552 1550 } … … 1555 1553 static private class BrowserApplication 1556 1554 extends Thread { 1557 private Process process = null;1555 private SafeProcess process = null; 1558 1556 /** The initial command string given to this sub-process. */ 1559 1557 private String command = null; … … 1595 1593 printArray(new_commands); 1596 1594 1597 Runtime rt = Runtime.getRuntime(); 1598 process = rt.exec(new_commands); 1599 int exitCode = process.waitFor(); 1595 process = new SafeProcess(new_commands); 1596 int exitCode = process.runProcess(); 1600 1597 if (exitCode != 0) { // if Netscape or mozilla was not open 1601 1598 DebugStream.println("couldn't do remote, trying original command"); 1602 1599 printArray(commands); 1603 process = rt.exec(commands); // try the original command 1600 process = null; 1601 process = new SafeProcess(commands); // try the original command 1602 process.runProcess(); 1604 1603 } 1605 1604 } else { … … 1611 1610 } 1612 1611 DebugStream.println("Running " + whole_command.toString()); 1613 Runtime rt = Runtime.getRuntime(); 1614 process = rt.exec(commands); 1615 process.waitFor(); 1612 process = new SafeProcess(commands); 1613 process.runProcess(); 1616 1614 } 1617 1615 } … … 1635 1633 public void stopBrowserApplication() { 1636 1634 if(process != null) { 1637 process.destroy(); 1635 SafeProcess.log("*** stopBrowserApplication called."); 1636 process.cancelRunningProcess(); 1638 1637 } 1639 1638 }
Note:
See TracChangeset
for help on using the changeset viewer.