diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-01 15:54:56 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-01 15:54:56 +0000 |
commit | 61e489ef7f24bcfd74ccdca798eb155c62ccd654 (patch) | |
tree | 8fabcac339905c223b5c65f018cba9de7b8a6fa2 /java/sca/modules | |
parent | a9bab245be80ea7b550ed22cc6bad6dbaf525dd6 (diff) |
Update to find file input stream correctly
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@770733 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r-- | java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java index 48b856140b..fd47e99b02 100644 --- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java +++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java @@ -24,6 +24,7 @@ import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
@@ -145,7 +146,7 @@ public class SpringXMLComponentTypeLoader { implementation.setURI(resource.toString());
// FIXME - need a better way to handle the XMLInputFactory than allocating a new one every time
XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
- reader = xmlFactory.createXMLStreamReader(new FileInputStream(resource.toString()));
+ reader = xmlFactory.createXMLStreamReader(new FileInputStream(new File(resource.toURI())));
// System.out.println("Spring TypeLoader - starting to read context file");
readContextDefinition(reader, beans, services, references, scaproperties);
@@ -154,6 +155,8 @@ public class SpringXMLComponentTypeLoader { throw new ContributionReadException(e);
} catch (XMLStreamException e) {
throw new ContributionReadException(e);
+ } catch (URISyntaxException e) {
+ throw new ContributionReadException(e);
}
/* At this point, the complete application-context.xml file has been read and its contents */
@@ -177,12 +180,14 @@ public class SpringXMLComponentTypeLoader { // FIXME - need a better way to handle the XMLInputFactory than allocating a new one every time
XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
XMLStreamReader reader =
- xmlFactory.createXMLStreamReader(new FileInputStream(resource.toString()));
+ xmlFactory.createXMLStreamReader(new FileInputStream(new File(resource.toURI())));
return reader;
} catch (IOException e) {
throw new ContributionReadException(e);
} catch (XMLStreamException e) {
throw new ContributionReadException(e);
+ } catch (URISyntaxException e) {
+ throw new ContributionReadException(e);
}
}
|