summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-impl/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-05-12 20:30:46 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-05-12 20:30:46 +0000
commit98458d8e914054ae9fe7e52b7252c7dbc259d26a (patch)
treedc48b15ad1304191851c6b889c41a8331d4ff559 /java/sca/modules/node-impl/src
parentf6a4ede25e5b869e14b9005a29b6e39f860823eb (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 '')
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
index 396d77af66..67486b0ab3 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
@@ -47,10 +47,18 @@ public class NodeUtil {
* @return
*/
static URI createURI(String uri) {
- if (uri.indexOf(' ') != -1) {
- uri = uri.replace(" ", "%20");
- }
- return URI.create(uri);
+ URI returnURI = null;
+
+ try {
+ returnURI = URI.create(uri);
+ } catch( Exception e) {
+ try {
+ returnURI = new URI(null, uri, null);
+ } catch (Exception ee) {
+ throw new IllegalArgumentException("Invalid URI :" + uri, ee);
+ }
+ }
+ return returnURI;
}
}