Changeset 24388 for main/trunk/gli/src/org/greenstone/gatherer
- Timestamp:
- 2011-08-10T18:54:49+12:00 (13 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r24358 r24388 373 373 } 374 374 else { 375 GS3ServerThread thread = new GS3ServerThread(gsdl _path, "start");375 GS3ServerThread thread = new GS3ServerThread(gsdl3_src_path, "restart"); 376 376 thread.start(); 377 377 } … … 715 715 String shellCommand = null; 716 716 Process p = null; 717 if (Utility.isWindows()) { 718 p = Runtime.getRuntime().exec("cmd /C \"cd " + Configuration.gsdl_path + File.separator + ".. && ant stop\"\""); 717 if (Utility.isWindows()) { 718 // cmd /C "cd "C:\path\to\greenstone3" && ant stop" 719 p = Runtime.getRuntime().exec("cmd /C \"cd \"" + Configuration.gsdl3_src_path + File.separator + "\" && ant stop\""); 719 720 } else { 720 p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant stop -f \"" + Configuration.gsdl _path + ".."+ File.separator + "build.xml\""});721 p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant stop -f \"" + Configuration.gsdl3_src_path + File.separator + "build.xml\""}); 721 722 } 722 723 } catch(Exception e) { -
main/trunk/gli/src/org/greenstone/gatherer/util/GS3ServerThread.java
r24333 r24388 42 42 public class GS3ServerThread extends Thread 43 43 { 44 String _gsdl _path = "";44 String _gsdl3_src_path = ""; 45 45 String _ant_command = ""; 46 46 47 public GS3ServerThread(String gsdl _path, String ant_command)47 public GS3ServerThread(String gsdl3_src_path, String ant_command) 48 48 { 49 _gsdl _path = gsdl_path;50 _ant_command = ant_command; 49 _gsdl3_src_path = gsdl3_src_path; 50 _ant_command = ant_command; // "restart" 51 51 } 52 52 … … 62 62 _ant_command = "start"; 63 63 } 64 p = Runtime.getRuntime().exec("cmd /C \"cd " + _gsdl_path + File.separator + ".. && ant " + _ant_command + "\"\""); 64 // The path in quotes, and the entire sequence of commands in quotes as well 65 // E.g. the following works: cmd /C "cd "C:\path\to\greenstone3" && ant stop" 66 // and it preserves any spaces in the path to GSDL3SRCHOME (_gsdl3_src_path). 67 p = Runtime.getRuntime().exec("cmd /C \"cd \"" + _gsdl3_src_path + File.separator + "\" && ant " + _ant_command + "\""); 65 68 } 66 69 else … … 69 72 _ant_command = "restart"; 70 73 } 71 p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant " + _ant_command + " -f \"" + _gsdl _path + ".."+ File.separator + "build.xml\""});74 p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant " + _ant_command + " -f \"" + _gsdl3_src_path + File.separator + "build.xml\""}); 72 75 } 73 76 }
Note:
See TracChangeset
for help on using the changeset viewer.