[wsas-java-dev] [wsas commit] r22 - in wsas/java/trunk: . modules/admin/src/org/wso2/wsas/admin/service

svn at wso2.com svn at wso2.com
Thu Nov 30 04:59:56 PST 2006


Author: azeez
Date: Thu Nov 30 04:59:56 2006
New Revision: 22

Modified:
   wsas/java/trunk/modules/admin/src/org/wso2/wsas/admin/service/ServiceAdmin.java
   wsas/java/trunk/project.properties
Log:
Give a proper msg if you are unable to delete faulty service

Modified: wsas/java/trunk/modules/admin/src/org/wso2/wsas/admin/service/ServiceAdmin.java
==============================================================================
--- wsas/java/trunk/modules/admin/src/org/wso2/wsas/admin/service/ServiceAdmin.java	(original)
+++ wsas/java/trunk/modules/admin/src/org/wso2/wsas/admin/service/ServiceAdmin.java	Thu Nov 30 04:59:56 2006
@@ -119,7 +119,7 @@
 
     public String addTransportBinding(String serviceId,
                                       String transportProtocol) throws AxisFault {
-        if(transportProtocol == null || transportProtocol.trim().length() == 0){
+        if (transportProtocol == null || transportProtocol.trim().length() == 0) {
             return "Invalid transport " + transportProtocol;
         }
         AxisService axisService = getAxisConfig().getService(serviceId);
@@ -1182,21 +1182,25 @@
         return false;
     }
 
-    public boolean deleteFaultyServiceArchive(String archiveName) {
+    public boolean deleteFaultyServiceArchive(String archiveName) throws AxisFault {
         if (File.separatorChar == '\\') {
             archiveName = archiveName.replace('/', '\\');
         }
 
-        File file = new File(archiveName);
         boolean isDeleted = false;
-
-        if (file.exists()) {
-            if (file.isDirectory() && new FileManipulator().deleteDir(file)) {
-                isDeleted = true;
-                getAxisConfig().getFaultyServices().remove(archiveName);
-            } else if (file.delete()) {
-                isDeleted = true;
-                getAxisConfig().getFaultyServices().remove(archiveName);
+        if (archiveName != null && archiveName.trim().length() != 0) {
+            File file = new File(archiveName);
+            if (file.exists()) {
+                if (!((file.isDirectory() && new FileManipulator().deleteDir(file)) ||
+                      file.delete())) {
+                    throw new AxisFault("Faulty service archive deletion failed. " +
+                                        "Due to a JVM issue on MS-Windows, " +
+                                        "AAR files cannot be deleted. " +
+                                        "Please stop the server and manually delete this file.");
+                } else {
+                    isDeleted = true;
+                    getAxisConfig().getFaultyServices().remove(archiveName);
+                }
             }
         }
 

Modified: wsas/java/trunk/project.properties
==============================================================================
--- wsas/java/trunk/project.properties	(original)
+++ wsas/java/trunk/project.properties	Thu Nov 30 04:59:56 2006
@@ -64,7 +64,7 @@
 #                Versions of dependencies
 # -------------------------------------------------------------------
 axis2.version=1.1.1-SNAPSHOT
-addressing.version=1.1-SNAPSHOT
+addressing.version=1.1.1-SNAPSHOT
 xmlsec.version=1.4-SNAPSHOT
 rampart.version=1.1-SNAPSHOT
 rahas.version=1.1-SNAPSHOT




More information about the Wsas-java-dev mailing list