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

lutoff
18.14.2008 d42b15e420478dc45785fff6e00b863cc1f8a0f9
opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
@@ -50,6 +50,7 @@
import org.opends.quicksetup.util.BackgroundTask;
import org.opends.quicksetup.util.ServerController;
import org.opends.quicksetup.util.UIKeyStore;
import org.opends.quicksetup.util.Utils;
import org.opends.server.admin.AttributeTypePropertyDefinition;
import org.opends.server.admin.ClassLoaderProvider;
import org.opends.server.admin.ClassPropertyDefinition;
@@ -586,6 +587,13 @@
  }
  /**
   * {@inheritDoc}
   */
  public String getInstancePath() {
    return getInstancePathFromClasspath(getInstallPathFromClasspath());
  }
  /**
   * Returns the ApplicationException that might occur during installation or
   * <CODE>null</CODE> if no exception occurred.
   *
@@ -1104,10 +1112,39 @@
      notifyListeners(getFormattedWithPoints(
          INFO_PROGRESS_DELETING_INSTALLATION_FILES_NON_VERBOSE.get()));
    }
    File f = new File(getInstallPathFromClasspath());
    String installPath = getInstallPathFromClasspath();
    File installFile = new File(installPath);
    String instancePath =
      Utils.getInstancePathFromClasspath(installFile.getAbsolutePath());
    File instanceFile = new File(instancePath);
    InstallationFilesToDeleteFilter filter =
            new InstallationFilesToDeleteFilter();
    File[] rootFiles = f.listFiles();
    File[] installFiles  = installFile.listFiles();
    File[] instanceFiles = new File(instancePath).listFiles();
    File[] rootFiles = null;
    if (installFiles == null)
    {
      rootFiles = new File(instancePath).listFiles();
    }
    else
    if (instanceFiles == null)
    {
      rootFiles = installFiles;
    }
    else
    {
      // both installFiles and instanceFiles are not null
      rootFiles = new File[installFiles.length + instanceFiles.length];
      System.arraycopy(installFiles,  0, rootFiles, 0, installFiles.length);
      System.arraycopy(instanceFiles, 0, rootFiles, installFiles.length,
          instanceFiles.length);
    }
    if (rootFiles != null) {
      /* The following is done to have a moving progress bar when we delete
       * the installation files.
@@ -1161,6 +1198,7 @@
                beforeRatio);
        deleteRecursively(rootFiles[i], filter);
      }
      deleteRecursively(instanceFile);
      hmRatio.put(UninstallProgressStep.DELETING_INSTALLATION_FILES, maxRatio);
    }
    if (!isVerbose())