From e08ee9a21301e4607806ff0230eca74d6dc3b13b Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Sat, 07 Apr 2007 00:06:48 +0000
Subject: [PATCH] completed migration of code to use Installer constants and methods for filesystem related tasks

---
 opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/StatusPanelController.java |   39 +++++++++------------------------------
 1 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/StatusPanelController.java b/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/StatusPanelController.java
index 72ee355..8e0812b 100644
--- a/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/StatusPanelController.java
+++ b/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/StatusPanelController.java
@@ -40,6 +40,7 @@
 import org.opends.server.core.DirectoryServer;
 
 import org.opends.quicksetup.CurrentInstallStatus;
+import org.opends.quicksetup.Installation;
 import org.opends.quicksetup.ui.UIFactory;
 import org.opends.quicksetup.util.BackgroundTask;
 import org.opends.quicksetup.util.HtmlProgressMessageFormatter;
@@ -531,14 +532,9 @@
         getFormattedProgress(getMsg("progress-starting")) + getLineBreak());
 
     ArrayList<String> argList = new ArrayList<String>();
-
-    if (Utils.isWindows())
-    {
-      argList.add(Utils.getPath(getBinariesPath(), "start-ds.bat"));
-    } else
-    {
-      argList.add(Utils.getPath(getBinariesPath(), "start-ds"));
-    }
+    Installation installation =
+            new Installation(Utils.getInstallPathFromClasspath());
+    argList.add(Utils.getPath(installation.getServerStartCommandFile()));
 
     String[] args = new String[argList.size()];
     argList.toArray(args);
@@ -655,16 +651,9 @@
         getFormattedProgress(getMsg("progress-stopping")) + getLineBreak());
 
     ArrayList<String> argList = new ArrayList<String>();
-
-    if (Utils.isWindows())
-    {
-      argList.add(Utils.getPath(getBinariesPath(),
-              Utils.getWindowsStopFileName()));
-    } else
-    {
-      argList.add(Utils.getPath(getBinariesPath(),
-              Utils.getUnixStopFileName()));
-    }
+    Installation installation =
+            new Installation(Utils.getInstallPathFromClasspath());
+    argList.add(Utils.getPath(installation.getServerStopCommandFile()));
     String[] args = new String[argList.size()];
     argList.toArray(args);
     ProcessBuilder pb = new ProcessBuilder(args);
@@ -894,7 +883,7 @@
    * have something of type:
    * key=value
    *
-   * @see ResourceProvider.getMsg(String key)
+   * @see ResourceProvider#getMsg(String)
    * @param key the key in the properties file.
    * @return the value associated to the key in the properties file.
    * properties file.
@@ -914,7 +903,7 @@
    * mykey=value with argument {0}.
    *
    * This method will return "value with argument value1".
-   * @see ResourceProvider.getMsg(String key, String[] args)
+   * @see ResourceProvider#getMsg(String, String[])
    * @param key the key in the properties file.
    * @param args the arguments to be passed to generate the resulting value.
    * @return the value associated to the key in the properties file.
@@ -934,16 +923,6 @@
   }
 
   /**
-   * Returns the path to the binaries.
-   * @return the path to the binaries.
-   */
-  private String getBinariesPath()
-  {
-    return Utils.getPath(Utils.getInstallPathFromClasspath(),
-        Utils.getBinariesRelativePath());
-  }
-
-  /**
    * Returns the formatted representation of the text that is the summary of the
    * installation process (the one that goes in the UI next to the progress
    * bar).

--
Gitblit v1.10.0