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

jvergara
22.05.2009 aa9e12e21be7146b317112a12f8186756c4969df
opends/src/server/org/opends/server/extensions/ConfigFileHandler.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.extensions;
@@ -690,7 +690,19 @@
        if ((configDirFile != null) &&
            configDirFile.getName().equals(CONFIG_DIR_NAME))
        {
          serverRoot = configDirFile.getParentFile().getAbsolutePath();
          /*
           * Do a best effort to avoid having a relative representation (for
           * instance to avoid having ../../../).
           */
          try
          {
            serverRoot = configDirFile.getParentFile().getCanonicalPath();
          }
          catch (IOException ioe)
          {
            // Best effort
            serverRoot = configDirFile.getParentFile().getAbsolutePath();
          }
        }
        if (serverRoot == null)
@@ -739,7 +751,19 @@
    }
    else
    {
      instanceRoot = instanceFile.getAbsolutePath();
      /*
       * Do a best effort to avoid having a relative representation (for
       * instance to avoid having ../../../).
       */
      try
      {
        instanceRoot = instanceFile.getCanonicalPath();
      }
      catch (IOException ioe)
      {
        // Best effort
        instanceRoot = instanceFile.getAbsolutePath();
      }
    }