mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

ludovicp
31.59.2010 8f8fa9a5bc51f0a11629031cb5bdc0753a839ade
opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -36,6 +36,7 @@
import static org.opends.quicksetup.util.Utils.*;
import org.opends.quicksetup.installer.InstallerHelper;
import org.opends.server.tools.ToolConstants;
import org.opends.server.util.SetupUtils;
import javax.naming.NamingException;
@@ -112,6 +113,21 @@
   *          if something goes wrong.
   */
  public void stopServer(boolean suppressOutput) throws ApplicationException {
    stopServer(suppressOutput,false);
  }
  /**
   * This methods stops the server.
   *
   * @param suppressOutput boolean indicating that ouput to standard output
   *                       streams from the server should be suppressed.
   * @param noPropertiesFile boolean indicating if the stopServer should
   *                       be called without taking into account the
   *                       properties file.
   * @throws org.opends.quicksetup.ApplicationException
   *          if something goes wrong.
   */
  public void stopServer(boolean suppressOutput,boolean noPropertiesFile)
  throws ApplicationException {
    if (suppressOutput && !StandardOutputSuppressor.isSuppressed()) {
      StandardOutputSuppressor.suppress();
@@ -135,8 +151,17 @@
      ArrayList<String> argList = new ArrayList<String>();
      argList.add(Utils.getScriptPath(
          Utils.getPath(installation.getServerStopCommandFile())));
      String[] args = new String[argList.size()];
      int size = argList.size();
      if (noPropertiesFile)
      {
        size++;
      }
      String[] args = new String[size];
      argList.toArray(args);
      if (noPropertiesFile)
      {
        args[argList.size()] = "--" + ToolConstants.OPTION_LONG_NO_PROP_FILE;
      }
      ProcessBuilder pb = new ProcessBuilder(args);
      Map<String, String> env = pb.environment();
      env.put(SetupUtils.OPENDS_JAVA_HOME, System.getProperty("java.home"));