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

Jean-Noël Rouvignac
10.09.2015 b1994018d9cb7d26571157270d5296ac3a368b7c
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java
@@ -945,39 +945,24 @@
      }
    }
    BufferedReader reader;
    try
    {
      reader = new BufferedReader(new FileReader(instancePathFileName));
    }
    catch (Exception e)
    {
      return installPath;
    }
    // Read the first line and close the file.
    String line;
    try
    try (BufferedReader reader = new BufferedReader(new FileReader(instancePathFileName)))
    {
      line = reader.readLine();
      String line = reader.readLine();
      File instanceLoc = new File(line.trim());
      if (instanceLoc.isAbsolute())
      {
        return instanceLoc.getAbsolutePath();
        return getCanonicalPath(instanceLoc);
      }
      else
      {
        return new File(installPath + File.separator + instanceLoc.getPath()).getAbsolutePath();
        return getCanonicalPath(new File(installPath + File.separator + instanceLoc.getPath()));
      }
    }
    catch (Exception e)
    {
      return installPath;
    }
    finally
    {
      StaticUtils.close(reader);
    }
  }
  /**
@@ -1997,14 +1982,7 @@
    if (installDir == null)
    {
      File f = org.opends.quicksetup.Installation.getLocal().getRootDirectory();
      try
      {
        installDir = f.getCanonicalPath();
      }
      catch (Throwable t)
      {
        installDir = f.getAbsolutePath();
      }
      installDir = getCanonicalPath(f);
      if (installDir.lastIndexOf(File.separatorChar) != installDir.length() - 1)
      {
        installDir += File.separatorChar;
@@ -2014,6 +1992,18 @@
    return installDir;
  }
  private static String getCanonicalPath(File f)
  {
    try
    {
      return f.getCanonicalPath();
    }
    catch (IOException t)
    {
      return f.getAbsolutePath();
    }
  }
  private static List<String> getDsReplicationEquivalentCommandLine(String subcommand, UserData userData,
      Set<String> baseDNs, ServerDescriptor server)
  {