Changeset 9580
- Timestamp:
- 2005-04-07T13:37:28+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r9350 r9580 214 214 } 215 215 216 // Check for ImageMagick 217 if (Gatherer.isGsdlRemote) { 218 DebugStream.println("Not checking for ImageMagick."); 219 } 220 else if (!(new ImageMagickTest()).found()) { 221 // Time for a warning message 222 missingImageMagick(); 223 } 224 216 225 if (Gatherer.isGsdlRemote) { 217 226 DebugStream.println("Not checking for perl path/exe"); … … 570 579 571 580 572 /** Prints a warning message about a missing GSDL path, which although not fatal pretty much ensures nothing will work properly in the G atherer.581 /** Prints a warning message about a missing GSDL path, which although not fatal pretty much ensures nothing will work properly in the GLI. 573 582 */ 574 583 static public void missingGSDL() { … … 579 588 } 580 589 581 /** Prints a warning message about a missing PERL path, which although not fatal pretty much ensures no collection creation/building will work properly in the Gatherer. */ 590 /** Prints a warning message about missing a valid ImageMagick path, which although not fatal means building image collections won't work */ 591 static public void missingImageMagick() { 592 WarningDialog dialog = new WarningDialog("warning.MissingImageMagick", "MissingImageMagick.Title", "MissingImageMagick.Message", null, false); 593 dialog.display(); 594 dialog.dispose(); 595 dialog = null; 596 } 597 598 /** Prints a warning message about missing a valid PERL path, which although not fatal pretty much ensures no collection creation/building will work properly in the GLI. */ 582 599 static public void missingPERL() { 583 600 WarningDialog dialog = new WarningDialog("warning.MissingPERL", "MissingPERL.Title", "MissingPERL.Message", null, false); … … 587 604 } 588 605 589 /** Prints a warning message about a missing a valid WGet path. not fatal, butmirroring won't work */606 /** Prints a warning message about missing a valid WGet path, which although not fatal means mirroring won't work */ 590 607 static public void missingWGET() { 591 608 WarningDialog dialog = new WarningDialog("warning.MissingWGET", "MissingWGET.Title", "MissingWGET.Message", null, false); … … 793 810 794 811 795 private class PerlTest { 796 812 private class ImageMagickTest 813 { 814 public boolean found() 815 { 816 try { 817 String command = (Utility.isWindows() ? "identify.exe" : "identify"); 818 Process image_magick_process = Runtime.getRuntime().exec(command); 819 image_magick_process.waitFor(); 820 return (image_magick_process.exitValue() == 0); 821 } 822 catch (Exception exception) { 823 return false; 824 } 825 } 826 } 827 828 829 private class PerlTest 830 { 797 831 private String[] command = new String[2]; 798 832 799 public PerlTest() { 800 if(Utility.isWindows()) { 801 command[0] = Utility.PERL_EXECUTABLE_WINDOWS; 802 } 803 else { 804 command[0] = Utility.PERL_EXECUTABLE_UNIX; 805 } 833 public PerlTest() 834 { 835 command[0] = (Utility.isWindows() ? Utility.PERL_EXECUTABLE_WINDOWS : Utility.PERL_EXECUTABLE_UNIX); 806 836 command[1] = "-version"; 807 837 } 808 838 809 public boolean found() {810 boolean found = false;839 public boolean found() 840 { 811 841 try { 812 Process prcs = Runtime.getRuntime().exec(command); 813 prcs.waitFor(); 814 found = (prcs.exitValue() == 0); 815 prcs = null; 816 } 817 catch(Exception error) { 818 } 819 return found; 842 Process perl_process = Runtime.getRuntime().exec(command); 843 perl_process.waitFor(); 844 return (perl_process.exitValue() == 0); 845 } 846 catch (Exception exception) { 847 return false; 848 } 820 849 } 821 850
Note:
See TracChangeset
for help on using the changeset viewer.