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

jvergara
05.04.2007 73b6faf791290e10ac84feb56361ab4bfa8196cc
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -72,6 +72,8 @@
{
  private static final int BUFFER_SIZE = 1024;
  private static final int MAX_LINE_WIDTH = 80;
  private static final String[] OPEN_DS_JAR_RELATIVE_PATHS =
    { "lib/quicksetup.jar", "lib/OpenDS.jar", "lib/je.jar" };
@@ -950,6 +952,8 @@
   */
  public static String getInstallPathFromClasspath()
  {
    String installPath;
    /* Get the install path from the Class Path */
    String sep = System.getProperty("path.separator");
    String[] classPaths = System.getProperty("java.class.path").split(sep);
@@ -969,7 +973,20 @@
    File f = new File(path).getAbsoluteFile();
    File binariesDir = f.getParentFile();
    return binariesDir.getParent();
    /*
     * Do a best effort to avoid having a relative representation (for
     * instance to avoid having ../../../).
     */
    try
    {
      installPath = binariesDir.getParentFile().getCanonicalPath();
    }
    catch (IOException ioe)
    {
      // Best effort
      installPath = binariesDir.getParent();
    }
    return installPath;
  }
  /**
@@ -1310,4 +1327,15 @@
    }
    return (InitialLdapContext) pair[0];
  }
  /**
   * Returns the max size in character of a line to be displayed in the command
   * line.
   * @return the max size in character of a line to be displayed in the command
   * line.
   */
  public static int getCommandLineMaxLineWidth()
  {
    return MAX_LINE_WIDTH;
  }
}