diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-12 20:30:46 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-12 20:30:46 +0000 |
commit | 98458d8e914054ae9fe7e52b7252c7dbc259d26a (patch) | |
tree | dc48b15ad1304191851c6b889c41a8331d4ff559 /java/sca/modules/assembly-xml/src | |
parent | f6a4ede25e5b869e14b9005a29b6e39f860823eb (diff) |
TUSCANY-3015 - Using URI to properly escape/unescape spaces in various parts of the runtime
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@774067 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/assembly-xml/src')
-rw-r--r-- | java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java index 183d6f3471..ec059ace81 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java @@ -20,9 +20,11 @@ package org.apache.tuscany.sca.assembly.xml; import java.io.ByteArrayInputStream; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.util.Collection; @@ -83,14 +85,24 @@ public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements } // end if InputStream scdlStream = null; try { - URLConnection connection = url.openConnection(); + URLConnection connection; + if (url.getProtocol().equals("file")) { + File scdlFile = new File(url.toURI().getPath()); + connection = scdlFile.toURL().openConnection(); + } else { + connection = url.openConnection(); + } connection.setUseCaches(false); scdlStream = connection.getInputStream(); } catch (IOException e) { ContributionReadException ce = new ContributionReadException("Exception reading " + uri, e); error("ContributionReadException", url, ce); throw ce; - } + } catch (URISyntaxException e) { + ContributionReadException ce = new ContributionReadException("Exception reading " + uri, e); + error("ContributionReadException", url, ce); + throw ce; + } return read(uri, scdlStream); } |