Пример #1
0
  /*
   * OI hook to call individual product configurations.
   */
  public ResultReport unConfigure(final PropertySheet propSheet, final boolean validateFlag) {

    try {
      if (productRef.getProductName().equals("Domain")) {
        LOGGER.log(Level.INFO, Msg.get("UNCONFIGURING_GLASSFISH", null));
        unconfigureGlassfish();
      }

      if (productRef.getProductName().equals("UpdateTool")) {
        LOGGER.log(Level.INFO, Msg.get("UNCONFIGURING_UPDATETOOL", null));
        unconfigureUpdatetool();
        org.glassfish.installer.util.FileUtils.deleteDirectory(
            new File(productRef.getInstallLocation() + File.separator + "updatetool"));
        org.glassfish.installer.util.FileUtils.deleteDirectory(
            new File(productRef.getInstallLocation() + File.separator + "pkg"));
      }
      /* Delete the newly created folder, on windows. No incremental uninstallation, so delete everything.*/
      String folderName = (String) TemplateProcessor.getInstance().getFromDataModel("PRODUCT_NAME");
      if (OSUtils.isWindows()) {
        WindowsShortcutManager wsShortMgr = new WindowsShortcutManager();
        wsShortMgr.deleteFolder(folderName);
      }
    } catch (Exception e) {
      LOGGER.log(Level.FINEST, e.getMessage());
    }

    return new ResultReport(
        ResultReport.ResultStatus.SUCCESS,
        "http://www.oracle.com/pls/topic/lookup?ctx=821-2427&id=sjsaseeig",
        "http://www.oracle.com/pls/topic/lookup?ctx=821-2427&id=sjsaseeig",
        null,
        productError);
  }
Пример #2
0
  /* Undo GlassFish configuration and post-installation setups.*/
  public void unconfigureGlassfish() {
    // Try to stop domain.
    stopDomain();
    LOGGER.log(Level.INFO, Msg.get("CLEANINGUP_DIRECTORIES", null));
    try {
      // Cleanup list includes both windows and non-windows files.
      // FileUtils does check for the file before deleting.
      String dirList[] = {
        productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "domains",
        productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "modules",
        productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "nodes",
        productRef.getInstallLocation() + File.separator + "glassfish" + File.separator + "lib"
      };
      for (int i = 0; i < dirList.length; i++) {
        LOGGER.log(Level.FINEST, dirList[i]);
        org.glassfish.installer.util.FileUtils.deleteDirectory(new File(dirList[i]));
      }

    } catch (Exception e) {
      LOGGER.log(Level.FINEST, e.getMessage() + "\n");
    }
  }