You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by is...@apache.org on 2010/08/17 08:10:10 UTC

svn commit: r986198 - in /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment: ServiceDeployer.java util/Utils.java

Author: isurues
Date: Tue Aug 17 06:10:09 2010
New Revision: 986198

URL: http://svn.apache.org/viewvc?rev=986198&view=rev
Log:
fixing an issue related to hierarchical services on Windows

Modified:
    axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
    axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java

Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java?rev=986198&r1=986197&r2=986198&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java (original)
+++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java Tue Aug 17 06:10:09 2010
@@ -179,7 +179,11 @@ public class ServiceDeployer extends Abs
             String serviceHierarchy = Utils.getServiceHierarchy(fileName, this.directory);
             fileName = Utils.getShortFileName(fileName);
             fileName = DeploymentEngine.getAxisServiceName(fileName);
-            fileName = serviceHierarchy + fileName;
+
+            //attach the hierarchical part if it is not null
+            if (serviceHierarchy != null) {
+                fileName = serviceHierarchy + fileName;
+            }
             AxisServiceGroup serviceGroup = axisConfig.removeServiceGroup(fileName);
             if (serviceGroup != null) {
                 configCtx.removeServiceGroupContext(serviceGroup);

Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?rev=986198&r1=986197&r2=986198&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original)
+++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Tue Aug 17 06:10:09 2010
@@ -1885,6 +1885,7 @@ public class Utils {
         if (filePath == null || serviceDir == null) {
             return "";
         }
+        filePath = formatPath(filePath);
         String[] splited = filePath.split("/" + serviceDir + "/");
         String serviceHierarchy = null;
         if (splited.length > 1) {
@@ -1903,6 +1904,19 @@ public class Utils {
     }
 
     /**
+     * Format the string paths to match any platform.. windows, linux etc..
+     *
+     * @param path - input file path
+     * @return formatted file path
+     */
+    public static String formatPath(String path) {
+        // removing white spaces
+        path = path.replaceAll("\\b\\s+\\b", "%20");
+        // replacing all "\" with "/"
+        return path.replace('\\', '/');
+    }
+
+    /**
      * Get the class name from a resource name referring to a class file.
      * 
      * @param resourceName the resource name