diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-06 17:18:40 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-06 17:18:40 +0000 |
commit | 6fc873ca14a2a415736a57b239bec0c9ffec2637 (patch) | |
tree | 6d3d920fbdd5e9b55b4fc3d6642e10c914bcb052 /java/sca/modules/node2-impl | |
parent | 70589e54de3f16a711c47a971676b65f0a6c5ed1 (diff) |
Fix for TUSCANY-2535
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@683333 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node2-impl')
-rw-r--r-- | java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index eb39b379b6..76cc89f59e 100644 --- a/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -421,6 +421,18 @@ public class NodeImpl implements SCANode2, SCAClient { MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); monitor = monitorFactory.createMonitor(); } + + /** + * Escape the space in URL string + * @param uri + * @return + */ + private static URI createURI(String uri) { + if (uri.indexOf(' ') != -1) { + uri = uri.replace(" ", "%20"); + } + return URI.create(uri); + } private void configureNode(ConfiguredNodeImplementation configuration) throws Exception { @@ -431,7 +443,7 @@ public class NodeImpl implements SCANode2, SCAClient { ContributionService contributionService = runtime.getContributionService(); List<Contribution> contributions = new ArrayList<Contribution>(); for (Contribution contribution : configuration.getContributions()) { - URI uri = URI.create(contribution.getLocation()); + URI uri = createURI(contribution.getLocation()); if (uri.getScheme() == null) { uri = new File(contribution.getLocation()).toURI(); } @@ -476,7 +488,7 @@ public class NodeImpl implements SCANode2, SCAClient { Contribution contribution; URL compositeURL; - URI uri = URI.create(configuration.getComposite().getURI()); + URI uri = createURI(configuration.getComposite().getURI()); if (uri.getScheme() == null) { // If the composite URI is a relative URI, try to resolve it within the contributions |