diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java index 69d2d24840..5d84933374 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java @@ -163,7 +163,9 @@ public class TuscanyRuntime { /* * Create a node from a file system directory. - * The directory can contain: + * If the directory is actually a file use createNodeFromXML + * if the directory contains a file named node.xml then use createNodeFromXML + * Otherwise, the directory can contain: * domain.properties * contributions - jar, zip, or exploded directories * sca-contribution.xml metaData files to override whats in a contribution @@ -173,6 +175,15 @@ public class TuscanyRuntime { */ public Node createNode(File directory) throws ContributionReadException, ValidationException, ActivationException, XMLStreamException, IOException { + if (!directory.isDirectory()) { + return createNodeFromXML(directory.toURI().toURL().toString()); + } + + File nodeXML = new File(directory, "node.xml"); + if (nodeXML.exists()) { + return createNodeFromXML(nodeXML.toURI().toURL().toString()); + } + Properties domainProps = new Properties(); File propsFile = new File(directory, "domain.properties"); if (propsFile.exists()) { |