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

kenneth_suter
23.29.2007 23faffa02e132a30c02f928e317c6f66ac373d06
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;
  }