summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/xsd/src
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/xsd/src')
-rw-r--r--sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java b/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
index d87f1a3ef1..80bdeb1a41 100644
--- a/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
+++ b/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
@@ -24,7 +24,6 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -366,13 +365,20 @@ public class XSDModelResolver implements ModelResolver {
return new InputSource(schemaLocation);
}
} else {
- // look to see whether Tuscany has a local version of the
- // required schema. It can load the local version rather
- // than going out to the network in order to improve performance
- url = Constants.CACHED_XSDS.get(targetNamespace);
-
- if (url == null) {
- url = new URL(new URL(baseUri), schemaLocation);
+ url = new URL(new URL(baseUri), schemaLocation);
+ String scheme = url.getProtocol();
+ if ("file".equalsIgnoreCase(scheme) || "jar".equalsIgnoreCase(scheme)
+ || "zip".equalsIgnoreCase(scheme)
+ || "wsjar".equalsIgnoreCase(scheme)) {
+ // For local URLs, use as-is
+ } else {
+ // look to see whether Tuscany has a local version of the
+ // required schema. It can load the local version rather
+ // than going out to the network in order to improve performance
+ URL cached = Constants.CACHED_XSDS.get(targetNamespace);
+ if (cached != null) {
+ url = cached;
+ }
}
}
return XMLDocumentHelper.getInputSource(url);