Ignore:
Timestamp:
2011-08-10T18:54:49+12:00 (13 years ago)
Author:
ak19
Message:

Fixed bug in starting and stopping GS3 server on Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/util/GS3ServerThread.java

    r24333 r24388  
    4242public class GS3ServerThread extends Thread
    4343{
    44     String _gsdl_path = "";
     44    String _gsdl3_src_path = "";
    4545    String _ant_command = "";
    4646   
    47     public GS3ServerThread(String gsdl_path, String ant_command)
     47    public GS3ServerThread(String gsdl3_src_path, String ant_command)
    4848    {
    49     _gsdl_path = gsdl_path;
    50     _ant_command = ant_command;
     49    _gsdl3_src_path = gsdl3_src_path;
     50    _ant_command = ant_command; // "restart"
    5151    }
    5252   
     
    6262                _ant_command = "start";
    6363            }
    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 + "\"");   
    6568            }
    6669        else
     
    6972                _ant_command = "restart";
    7073            }
    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\""});
    7275            }
    7376        }
Note: See TracChangeset for help on using the changeset viewer.