Asankha,

Your modification changes the behavior of CustomURIResolver#resolveEntity in the case where resourceMap != null and ResourceMap#resolve returns null: instead of resolving the URI using SynapseConfigUtils.resolveRelativeURI, it now returns null. Is this intentional or a mistake?

Andreas

On 30 Apr 2008, at 13:25, [EMAIL PROTECTED] wrote:

Author: asankha
Date: Wed Apr 30 04:25:31 2008
New Revision: 652335

URL: http://svn.apache.org/viewvc?rev=652335&view=rev
Log:
fix SYNAPSE-274

Modified:
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ config/SynapseConfigUtils.java synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ core/axis2/CustomURIResolver.java synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ core/axis2/CustomWSDLLocator.java

Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/ synapse/config/SynapseConfigUtils.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfigUtils.java?rev=652335&r1=652334&r2=652335&view=diff
= = = = = = = = ====================================================================== --- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ config/SynapseConfigUtils.java (original) +++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ config/SynapseConfigUtils.java Wed Apr 30 04:25:31 2008
@@ -402,7 +402,7 @@
        return url;
    }

- public static InputSource resolveRelativeURI(String parentLocation, String relativeLocation) { + public static String resolveRelativeURI(String parentLocation, String relativeLocation) {

        if (relativeLocation == null) {
throw new IllegalArgumentException("Import URI cannot be null");
@@ -416,21 +416,21 @@
        try {
            importUri = new URI(relativeLocation);
            if (importUri.isAbsolute()) {
-                return getInputSourceFormURI(importUri);
+                return importUri.toString();
            }
        } catch (URISyntaxException e) {
-            handleException("Invalid URI", e);
+            handleException("Invalid URI : " + relativeLocation, e);
        }

        if (parentLocation == null) {
-            return getInputSourceFormURI(importUri);
+            return importUri.toString();
        } else {
            // if the importuri is absolute
if (relativeLocation.startsWith("/") || relativeLocation.startsWith("\\")) {
                if (importUri != null && !importUri.isAbsolute()) {
                    try {
importUri = new URI("file:" + relativeLocation);
-                        return getInputSourceFormURI(importUri);
+                        return importUri.toString();
                    } catch (URISyntaxException e) {
handleException("Invalid URI ' " + importUri.getPath() + " '", e);
                    }
@@ -448,12 +448,12 @@
                        if (!resolvedUri.isAbsolute()) {
resolvedUri = new URI("file:" + resolvedPath);
                        }
-                        return getInputSourceFormURI(resolvedUri);
+                        return resolvedUri.toString();
                    } catch (URISyntaxException e) {
handleException("Invalid URI ' " + resolvedPath + " '", e);
                    }
                } else {
-                    return getInputSourceFormURI(importUri);
+                    return importUri.toString();
                }
            }
        }

Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/ synapse/core/axis2/CustomURIResolver.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/CustomURIResolver.java?rev=652335&r1=652334&r2=652335&view=diff
= = = = = = = = ====================================================================== --- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ core/axis2/CustomURIResolver.java (original) +++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ core/axis2/CustomURIResolver.java Wed Apr 30 04:25:31 2008
@@ -42,13 +42,10 @@
    }

public InputSource resolveEntity(String targetNamespace, String schemaLocation, String baseUri) {
-        InputSource result = null;
        if (resourceMap != null) {
-            result = resourceMap.resolve(synCfg, schemaLocation);
+            return resourceMap.resolve(synCfg, schemaLocation);
+        } else {
+ return new InputSource(SynapseConfigUtils.resolveRelativeURI(baseUri, schemaLocation));
        }
-        if (result == null) {
- result = SynapseConfigUtils.resolveRelativeURI(baseUri, schemaLocation);
-        }
-        return result;
    }
}

Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/ synapse/core/axis2/CustomWSDLLocator.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/CustomWSDLLocator.java?rev=652335&r1=652334&r2=652335&view=diff
= = = = = = = = ====================================================================== --- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ core/axis2/CustomWSDLLocator.java (original) +++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ core/axis2/CustomWSDLLocator.java Wed Apr 30 04:25:31 2008
@@ -65,7 +65,7 @@
            result = resourceMap.resolve(synCfg, relativeLocation);
        }
        if (result == null) {
- result = SynapseConfigUtils.resolveRelativeURI(parentLocation, relativeLocation); + result = new InputSource(SynapseConfigUtils.resolveRelativeURI(parentLocation, relativeLocation));
        }
        this.latestImportURI = relativeLocation;
        return result;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to