- Timestamp:
- 2011-08-10T18:54:49+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.