Author: rareddy
Date: 2012-05-15 17:19:01 -0400 (Tue, 15 May 2012)
New Revision: 4103
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
Log:
TEIID-2046: StaxSource is not supported by the apache.xerces library which is used by AS7
runtime.
Modified: trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2012-05-15
18:48:10 UTC (rev 4102)
+++ trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2012-05-15
21:19:01 UTC (rev 4103)
@@ -24,20 +24,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
import javax.xml.XMLConstants;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.stax.StAXSource;
+import javax.xml.stream.*;
+import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
@@ -83,15 +74,12 @@
return null;
}
- public static void validate(InputStream content) throws SAXException,
- IOException, XMLStreamException {
+ public static void validate(InputStream content) throws SAXException, IOException {
try {
- XMLInputFactory inputFactory = XMLType.getXmlInputFactory();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(content);
SchemaFactory schemaFactory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema =
schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd"));
//$NON-NLS-1$
Validator v = schema.newValidator();
- v.validate(new StAXSource(reader));
+ v.validate(new StreamSource(content));
} finally {
content.close();
}
Show replies by date