From f8372f9b8f798114d0b4fa896abeac187c074480 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 16 Nov 2007 16:41:24 +0000
Subject: [PATCH] Fix for issue 1618 unable to install to folder with DN syntax.

---
 opends/src/server/org/opends/server/util/SetupUtils.java |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/SetupUtils.java b/opends/src/server/org/opends/server/util/SetupUtils.java
index 963d434..08716ff 100644
--- a/opends/src/server/org/opends/server/util/SetupUtils.java
+++ b/opends/src/server/org/opends/server/util/SetupUtils.java
@@ -487,5 +487,28 @@
   {
     return "true".equals(System.getProperty(IS_WEBSTART));
   }
+
+  /**
+   * Returns the String that can be used to launch an script using Runtime.exec.
+   * This method is required because in Windows the script that contain a "="
+   * in their path must be quoted.
+   * @param script the script name
+   * @return the absolute path for the given parentPath and relativePath.
+   */
+  public static String getScriptPath(String script)
+  {
+    String s = script;
+    if (isWindows())
+    {
+      if (s != null)
+      {
+        if (!s.startsWith("\"") || !s.endsWith("\""))
+        {
+          s = "\""+script+"\"";
+        }
+      }
+    }
+    return s;
+  }
 }
 

--
Gitblit v1.10.0