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

jvergara
30.53.2008 652b7ed3ab5ec5222cb769f1bbc4b06ef0f09c03
When there is a problem deleting files in the uninstaller, just consider it a warning and inform the user that the problematic file might being used by another process.
3 files modified
100 ■■■■■ changed files
opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/UninstallProgressStep.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java 79 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/admin_tool.properties 11 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/UninstallProgressStep.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 *      Portions Copyright 2006-2008 Sun Microsystems, Inc.
 */
package org.opends.guitools.uninstaller;
@@ -85,6 +85,11 @@
  FINISHED_WITH_ERROR_ON_REMOTE,
  /**
   * Installation finished but not all the files could be deleted.
   */
  FINISHED_WITH_ERROR_DELETING,
  /**
   * Installation finished with an error.
   */
  FINISHED_WITH_ERROR;
@@ -95,7 +100,8 @@
  public boolean isLast() {
    return this == FINISHED_SUCCESSFULLY ||
    this == FINISHED_WITH_ERROR ||
    this == FINISHED_WITH_ERROR_ON_REMOTE;
    this == FINISHED_WITH_ERROR_ON_REMOTE ||
    this == FINISHED_WITH_ERROR_DELETING;
  }
  /**
opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 *      Portions Copyright 2006-2008 Sun Microsystems, Inc.
 */
package org.opends.guitools.uninstaller;
@@ -91,6 +91,7 @@
  private ProgressStep status = UninstallProgressStep.NOT_STARTED;
  private boolean runStarted;
  private boolean errorOnRemoteOccurred;
  private boolean errorDeletingOccurred;
  private HashMap<ProgressStep, Integer> hmRatio =
          new HashMap<ProgressStep, Integer>();
@@ -656,7 +657,7 @@
            getFormattedSuccess(successMsg));
    Message nonCriticalMsg;
    if (isCli())
    if (!isCli())
    {
      nonCriticalMsg =
        INFO_SUMMARY_UNINSTALL_FINISHED_WITH_ERROR_ON_REMOTE.get();
@@ -668,6 +669,18 @@
    }
    hmSummary.put(UninstallProgressStep.FINISHED_WITH_ERROR_ON_REMOTE,
            getFormattedWarning(nonCriticalMsg));
    if (!isCli())
    {
      nonCriticalMsg =
        INFO_SUMMARY_UNINSTALL_FINISHED_WITH_ERROR_DELETING.get();
    }
    else
    {
      nonCriticalMsg =
        INFO_SUMMARY_UNINSTALL_FINISHED_WITH_ERROR_DELETING_CLI.get();
    }
    hmSummary.put(UninstallProgressStep.FINISHED_WITH_ERROR_DELETING,
        getFormattedWarning(nonCriticalMsg));
    hmSummary.put(UninstallProgressStep.FINISHED_WITH_ERROR,
            getFormattedError(
                    INFO_SUMMARY_UNINSTALL_FINISHED_WITH_ERROR.get()));
@@ -790,8 +803,24 @@
          notifyListeners(getTaskSeparator());
        }
        deleteExternalDatabaseFiles(dbsToDelete);
        displaySeparator = true;
        try
        {
          deleteExternalDatabaseFiles(dbsToDelete);
          displaySeparator = true;
        }
        catch (ApplicationException ae)
        {
          if (ae.getType() == ReturnCode.FILE_SYSTEM_ACCESS_ERROR)
          {
            errorDeletingOccurred = true;
            Message msg = getFormattedWarning(ae.getMessageObject());
            notifyListeners(msg);
          }
          else
          {
            throw ae;
          }
        }
      }
      Set<String> logsToDelete =
@@ -803,8 +832,24 @@
          notifyListeners(getTaskSeparator());
        }
        deleteExternalLogFiles(logsToDelete);
        displaySeparator = true;
        try
        {
          deleteExternalLogFiles(logsToDelete);
          displaySeparator = true;
        }
        catch (ApplicationException ae)
        {
          if (ae.getType() == ReturnCode.FILE_SYSTEM_ACCESS_ERROR)
          {
            errorDeletingOccurred = true;
            Message msg = getFormattedWarning(ae.getMessageObject());
            notifyListeners(msg);
          }
          else
          {
            throw ae;
          }
        }
      }
      UninstallUserData userData = getUninstallUserData();
@@ -820,13 +865,33 @@
      if (somethingToDelete) {
        status = UninstallProgressStep.DELETING_INSTALLATION_FILES;
        deleteInstallationFiles(getRatio(status),
        try
        {
          deleteInstallationFiles(getRatio(status),
                getRatio(UninstallProgressStep.FINISHED_SUCCESSFULLY));
        }
        catch (ApplicationException ae)
        {
          if (ae.getType() == ReturnCode.FILE_SYSTEM_ACCESS_ERROR)
          {
            errorDeletingOccurred = true;
            Message msg = getFormattedWarning(ae.getMessageObject());
            notifyListeners(msg);
          }
          else
          {
            throw ae;
          }
        }
      }
      if (errorOnRemoteOccurred)
      {
        status = UninstallProgressStep.FINISHED_WITH_ERROR_ON_REMOTE;
      }
      else if (errorDeletingOccurred)
      {
        status = UninstallProgressStep.FINISHED_WITH_ERROR_DELETING;
      }
      else
      {
        status = UninstallProgressStep.FINISHED_SUCCESSFULLY;
opendj-sdk/opends/src/messages/messages/admin_tool.properties
@@ -326,6 +326,17 @@
INFO_SUMMARY_UNINSTALL_FINISHED_WITH_ERROR_ON_REMOTE_CLI=OpenDS was \
 successfully uninstalled in the local machine but some error occurred \
 updating remote servers.
INFO_SUMMARY_UNINSTALL_FINISHED_WITH_ERROR_DELETING=<b>OpenDS Uninstall \
 Succeeded With Warnings</b><br>OpenDS was successfully uninstalled in the \
 local machine but some error occurred deleting files.  Check \
 'Details' text area for more information about the files that caused the \
 problem.<br><br>Verify that there is no other program using those files and \
 delete them manually.
INFO_SUMMARY_UNINSTALL_FINISHED_WITH_ERROR_DELETING_CLI=OpenDS was \
 successfully uninstalled in the local machine but some error occurred \
 deleting files.  Check 'Details' text area for more information about the \
 files that caused the problem.%n%nVerify that there is no other program \
 using those files and delete them manually.
INFO_SUMMARY_UNINSTALL_NOT_STARTED=Starting Uninstallation...
INFO_UNDEFINED_PROTOCOL_LABEL=-Unknown-
SEVERE_ERR_UNINSTALL_LAUNCHER_GUI_LAUNCHED_FAILED=%n%nThe graphical Uninstall \