From 14f210825823c17cff84d9221fa76673cbe27aa9 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Mon, 23 Apr 2007 00:29:32 +0000
Subject: [PATCH] The commit contains code for the following:
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index 452ec9e..5923745 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -898,7 +898,7 @@
*/
public static String getInstallPathFromClasspath()
{
- String installPath;
+ String installPath = null;
/* Get the install path from the Class Path */
String sep = System.getProperty("path.separator");
@@ -916,21 +916,23 @@
}
}
}
- File f = new File(path).getAbsoluteFile();
- File librariesDir = f.getParentFile();
+ if (path != null) {
+ File f = new File(path).getAbsoluteFile();
+ File librariesDir = f.getParentFile();
- /*
- * Do a best effort to avoid having a relative representation (for
- * instance to avoid having ../../../).
- */
- try
- {
- installPath = librariesDir.getParentFile().getCanonicalPath();
- }
- catch (IOException ioe)
- {
- // Best effort
- installPath = librariesDir.getParent();
+ /*
+ * Do a best effort to avoid having a relative representation (for
+ * instance to avoid having ../../../).
+ */
+ try
+ {
+ installPath = librariesDir.getParentFile().getCanonicalPath();
+ }
+ catch (IOException ioe)
+ {
+ // Best effort
+ installPath = librariesDir.getParent();
+ }
}
return installPath;
}
--
Gitblit v1.10.0