From 1d0ca0d129756c9aea37ad5165e19c1ba0a8faf0 Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 14 Oct 2009 17:09:50 +0000 Subject: Resolve relative path of the contribution locations against the node.xml git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@825196 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/tuscany/sca/node/NodeFactory.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'java/sca/modules/node-api/src/main') diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java index a92dbdb03b..24dac505ef 100644 --- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java +++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java @@ -245,7 +245,8 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { public Node createNode(URL configurationURL) { try { InputStream is = openStream(configurationURL); - return createNode(is); + NodeConfiguration configuration = loadConfiguration(is, configurationURL); + return createNode(configuration); } catch (IOException e) { throw new ServiceRuntimeException(e); } @@ -258,13 +259,8 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { * @return a new SCA node */ public Node createNode(InputStream is) { - try { - NodeConfiguration configuration = loadConfiguration(is); - is.close(); - return createNode(configuration); - } catch (IOException e) { - throw new ServiceRuntimeException(e); - } + NodeConfiguration configuration = loadConfiguration(is, null); + return createNode(configuration); } /** @@ -442,7 +438,7 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { * @param configuration The input stream of the XML document * @return The node configuration */ - public abstract NodeConfiguration loadConfiguration(InputStream xml); + public abstract NodeConfiguration loadConfiguration(InputStream xml, URL base); } -- cgit v1.2.3