You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2009/05/01 17:54:57 UTC
svn commit: r770733 -
/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
Author: antelder
Date: Fri May 1 15:54:56 2009
New Revision: 770733
URL: http://svn.apache.org/viewvc?rev=770733&view=rev
Log:
Update to find file input stream correctly
Modified:
tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
Modified: tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java?rev=770733&r1=770732&r2=770733&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java (original)
+++ tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java Fri May 1 15:54:56 2009
@@ -24,6 +24,7 @@
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 @@
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 @@
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 @@
// 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);
}
}