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

kenneth_suter
15.55.2007 883c4b7810dcabba4ebe2924ca0757485f5312da
opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallCliHelper.java
@@ -33,6 +33,10 @@
import java.util.HashSet;
import java.util.Set;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.io.IOException;
/**
 * The class used to provide some CLI interface in the uninstall.
@@ -46,6 +50,9 @@
 */
class UninstallCliHelper extends CliApplicationHelper {
  static private final Logger LOG =
          Logger.getLogger(UninstallCliHelper.class.getName());
  static private String FORMAT_KEY = "cli-uninstall-confirm-prompt";
  /**
@@ -83,8 +90,23 @@
    /* Step 2: If this is not a silent install ask for confirmation to delete
     * the different parts of the installation
     */
    Set<String> outsideDbs = getOutsideDbs(installStatus);
    Set<String> outsideLogs = getOutsideLogs(installStatus);
    Set<String> outsideDbs;
    Set<String> outsideLogs;
    Configuration config =
            Installation.getLocal().getCurrentConfiguration();
    try {
      outsideDbs = config.getOutsideDbs();
    } catch (IOException ioe) {
      outsideDbs = Collections.emptySet();
      LOG.log(Level.INFO, "error determining outside databases", ioe);
    }
    try {
      outsideLogs = config.getOutsideLogs();
    } catch (IOException ioe) {
      outsideLogs = Collections.emptySet();
      LOG.log(Level.INFO, "error determining outside logs", ioe);
    }
    if (silentUninstall)
    {
@@ -121,30 +143,6 @@
  }
  /**
   * Returns a Set of relative paths containing the db paths outside the
   * installation.
   * @param installStatus the Current Install Status object.
   * @return a Set of relative paths containing the db paths outside the
   * installation.
   */
  private Set<String> getOutsideDbs(CurrentInstallStatus installStatus)
  {
    return Utils.getOutsideDbs(installStatus);
  }
  /**
   * Returns a Set of relative paths containing the log paths outside the
   * installation.
   * @param installStatus the Current Install Status object.
   * @return a Set of relative paths containing the log paths outside the
   * installation.
   */
  private Set<String> getOutsideLogs(CurrentInstallStatus installStatus)
  {
    return Utils.getOutsideLogs(installStatus);
  }
  /**
   * Commodity method used to ask the user to confirm the deletion of certain
   * parts of the server.  It updates the provided UserData object
   * accordingly.  Returns <CODE>true</CODE> if the user cancels and <CODE>
@@ -325,8 +323,8 @@
  throws UserDataException
  {
    boolean cancelled = false;
    if (CurrentInstallStatus.isServerRunning())
    Status status = Installation.getLocal().getStatus();
    if (status.isServerRunning())
    {
        if (!silentUninstall)
        {
@@ -337,7 +335,7 @@
        if (!cancelled)
        {
            /* During all the confirmations, the server might be stopped. */
            userData.setStopServer(CurrentInstallStatus.isServerRunning());
            userData.setStopServer(status.isServerRunning());
        }
    }
    else