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.
| | |
| | | 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() |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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) |
| | | { |
| | |
| | | // 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) |
| | | { |
| | |
| | | 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); |
| | |
| | | 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 |
| | | { |