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

jvergara
28.14.2009 66962c445640f43cf0b1a0bfef5afc9f05e511ac
Fix for issue 3943 (Inconsistent installation path across tools)
Try to use File.getCanonicalPath to display the paths. If this does not work use File.getAbsolutePath() as fall back.
6 files modified
53 ■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/ui/BackupListPanel.java 7 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java 6 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java 5 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/DirectoryServer.java 12 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tasks/ExportTask.java 11 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tasks/ImportTask.java 12 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/BackupListPanel.java
@@ -522,9 +522,10 @@
    if (!backupDirectoryInitialized &&
        (parentDirectory.getText().length() == 0))
    {
      final String path = new File(desc.getInstancePath(),
          org.opends.quicksetup.Installation.BACKUPS_PATH_RELATIVE).
          getAbsolutePath();
      final String path =
        org.opends.quicksetup.util.Utils.getPath(
            new File(desc.getInstancePath(),
                org.opends.quicksetup.Installation.BACKUPS_PATH_RELATIVE));
      SwingUtilities.invokeLater(new Runnable()
      {
        public void run()
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -2069,7 +2069,8 @@
            getFormattedSuccess(
                    INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY.get(
                            formatter.getFormattedText(
                                    Message.raw(getInstancePath())),
                                    Message.raw(
                                        getPath(new File(getInstancePath())))),
                            INFO_GENERAL_SERVER_STOPPED.get(),
                            cmd)));
    hmSummary.put(InstallProgressStep.FINISHED_CANCELED,
@@ -2103,7 +2104,8 @@
            getFormattedSuccess(
                    INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY.get(
                            formatter.getFormattedText(
                                    Message.raw(getInstancePath())),
                                    Message.raw(
                                        getPath(new File(getInstancePath())))),
                            status,
                            cmd)));
    hmSummary.put(InstallProgressStep.FINISHED_WITH_ERROR,
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -249,9 +249,10 @@
  }
  /**
   * Returns the absolute path for the given parentPath and relativePath.
   * Returns the absolute path for the given file.  It tries to get the
   * canonical file path.  If it fails it returns the string representation.
   * @param f File to get the path
   * @return the absolute path for the given parentPath and relativePath.
   * @return the absolute path for the given file.
   */
  public static String getPath(File f)
  {
opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -1213,8 +1213,16 @@
    // Perform the handler-specific initialization.
    try
    {
      configHandler.initializeConfigHandler(configFile.getAbsolutePath(),
                                            false);
      String path;
      try
      {
        path = configFile.getCanonicalPath();
      }
      catch (Exception ex)
      {
        path = configFile.getAbsolutePath();
      }
      configHandler.initializeConfigHandler(path, false);
    }
    catch (InitializationException ie)
    {
opends/src/server/org/opends/server/tasks/ExportTask.java
@@ -230,8 +230,15 @@
    File f = new File (ldifFile);
    if (! f.isAbsolute())
    {
      ldifFile = new File(DirectoryServer.getInstanceRoot(), ldifFile)
          .getAbsolutePath();
      f = new File(DirectoryServer.getInstanceRoot(), ldifFile);
      try
      {
        ldifFile = f.getCanonicalPath();
      }
      catch (Exception ex)
      {
        ldifFile = f.getAbsolutePath();
      }
    }
    attrList = taskEntry.getAttribute(typeBackendID);
opends/src/server/org/opends/server/tasks/ImportTask.java
@@ -290,8 +290,16 @@
      File f = new File (s);
      if (!f.isAbsolute())
      {
        ldifFiles.add(new File(DirectoryServer.getInstanceRoot(), s)
            .getAbsolutePath());
        f = new File(DirectoryServer.getInstanceRoot(), s);
        try
        {
          s = f.getCanonicalPath();
        }
        catch (Exception ex)
        {
          s = f.getAbsolutePath();
        }
        ldifFiles.add(s);
      }
      else
      {