|
Lines 36-42
Link Here
|
| 36 |
* @author Ernest Jessee |
36 |
* @author Ernest Jessee |
| 37 |
* @author Paul E. Slauenwhite |
37 |
* @author Paul E. Slauenwhite |
| 38 |
* @author Duwayne Morris |
38 |
* @author Duwayne Morris |
| 39 |
* @version February 28, 2008 |
39 |
* @version April 2, 2008 |
| 40 |
* @since April 22, 2005 |
40 |
* @since April 22, 2005 |
| 41 |
* @deprecated This is not public API. It will be moved to internal in TPTP 5.0. |
41 |
* @deprecated This is not public API. It will be moved to internal in TPTP 5.0. |
| 42 |
*/ |
42 |
*/ |
|
Lines 450-463
Link Here
|
| 450 |
for (int i = 0; i < regInfo.length; i++) |
450 |
for (int i = 0; i < regInfo.length; i++) |
| 451 |
{ |
451 |
{ |
| 452 |
if (i == 2 && bRunningVista == false){ // the Java command console registry setting is not available on Vista |
452 |
if (i == 2 && bRunningVista == false){ // the Java command console registry setting is not available on Vista |
|
|
453 |
|
| 453 |
registryChange = Runtime.getRuntime().exec(consolecmdLine + regInfo[i],null); |
454 |
registryChange = Runtime.getRuntime().exec(consolecmdLine + regInfo[i],null); |
| 454 |
|
455 |
|
|
|
456 |
registryChange.waitFor(); |
| 457 |
|
| 458 |
//Since the regedit process may terminate before the exported registry file is created, |
| 459 |
//check if the file is created every 200 ms to a maximum of 1 second: |
| 460 |
for (int counter = 0; counter < 5; counter++) { |
| 461 |
|
| 462 |
if(consoleFile.exists()){ |
| 463 |
break; |
| 464 |
} |
| 465 |
else{ |
| 466 |
|
| 467 |
try { |
| 468 |
Thread.sleep(200); |
| 469 |
} |
| 470 |
catch (InterruptedException e) { |
| 471 |
//Ignore and continue. |
| 472 |
} |
| 473 |
} |
| 474 |
} |
| 455 |
} |
475 |
} |
| 456 |
else { |
476 |
else { |
|
|
477 |
|
| 457 |
registryChange = Runtime.getRuntime().exec(cmdLine + regInfo[i],null); |
478 |
registryChange = Runtime.getRuntime().exec(cmdLine + regInfo[i],null); |
| 458 |
} |
479 |
|
|
|
480 |
registryChange.waitFor(); |
| 459 |
|
481 |
|
| 460 |
registryChange.waitFor(); |
482 |
//Since the regedit process may terminate before the exported registry file is created, |
|
|
483 |
//check if the file is created every 200 ms to a maximum of 1 second: |
| 484 |
for (int counter = 0; counter < 5; counter++) { |
| 485 |
|
| 486 |
if(file.exists()){ |
| 487 |
break; |
| 488 |
} |
| 489 |
else{ |
| 490 |
|
| 491 |
try { |
| 492 |
Thread.sleep(200); |
| 493 |
} |
| 494 |
catch (InterruptedException e) { |
| 495 |
//Ignore and continue. |
| 496 |
} |
| 497 |
} |
| 498 |
} |
| 499 |
} |
| 500 |
|
| 461 |
if (i == 2 && bRunningVista == false){ |
501 |
if (i == 2 && bRunningVista == false){ |
| 462 |
// the Java command console registry setting is not available on Vista |
502 |
// the Java command console registry setting is not available on Vista |
| 463 |
// so this was throwing a File I/O exception |
503 |
// so this was throwing a File I/O exception |
|
Lines 480-490
Link Here
|
| 480 |
} |
520 |
} |
| 481 |
catch (IOException e) |
521 |
catch (IOException e) |
| 482 |
{ |
522 |
{ |
| 483 |
e.printStackTrace(); |
523 |
TestCorePlugin.getDefault().logError(e); |
| 484 |
} |
524 |
} |
| 485 |
catch (InterruptedException e) |
525 |
catch (InterruptedException e) |
| 486 |
{ |
526 |
{ |
| 487 |
e.printStackTrace(); |
527 |
TestCorePlugin.getDefault().logError(e); |
| 488 |
} |
528 |
} |
| 489 |
finally |
529 |
finally |
| 490 |
{ |
530 |
{ |
|
Lines 495-501
Link Here
|
| 495 |
} |
535 |
} |
| 496 |
catch (IOException e1) |
536 |
catch (IOException e1) |
| 497 |
{ |
537 |
{ |
| 498 |
e1.printStackTrace(); |
538 |
//Ignore since closing input stream reader. |
| 499 |
} |
539 |
} |
| 500 |
} |
540 |
} |
| 501 |
return inputFileContents; |
541 |
return inputFileContents; |