Fixed issue 8992. Now if the module folder cannot be deleted when uninstalling a module, an error message will be shown, instead of a 'Process completed succesfully' message.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Fri, 05 Jun 2009 18:18:43 +0200
changeset 3975 5438aedafc40
parent 3974 484ba1af6b88
child 3976 1dbeb09b3b1f
Fixed issue 8992. Now if the module folder cannot be deleted when uninstalling a module, an error message will be shown, instead of a 'Process completed succesfully' message.
src/org/openbravo/erpCommon/modules/UninstallModule.java
--- a/src/org/openbravo/erpCommon/modules/UninstallModule.java	Fri Jun 05 17:26:18 2009 +0200
+++ b/src/org/openbravo/erpCommon/modules/UninstallModule.java	Fri Jun 05 18:18:43 2009 +0200
@@ -134,11 +134,15 @@
             UninstallModuleData.insertLog(pool, (vars == null ? "0" : vars.getUser()),
                 data[i].adModuleId, data[i].version, data[i].name, "Uninstalled module "
                     + data[i].name + " - " + data[i].version, "D");
-            final File f = new File(modulesBaseDir + "/" + data[i].javapackage);
+            final File f = new File(modulesBaseDir, data[i].javapackage);
             if (f.exists()) {
               if (!Utility.deleteDir(f)) {
                 addLog("@CannotRemoveModule@ " + data[i].name, MSG_ERROR);
                 log4j.error("Cannot remove module contents " + data[i].name);
+              }
+              if (f.exists()) {
+                addLog("@CannotRemoveModule@ " + data[i].name, MSG_ERROR);
+                log4j.error("Cannot remove module contents " + data[i].name);
               } else {
                 addLog("@RemovedModule@ " + data[i].name, MSG_SUCCESS);
                 log4j.info("Removed contents for module " + data[i].name);