User: schulze
Date: 00/11/02 14:32:34
Modified: src/main/org/jboss/metadata XmlFileLoader.java
Log:
added a method and fixed the localisation of the standardjboss.xml file
Revision Changes Path
1.7 +14 -3 jboss/src/main/org/jboss/metadata/XmlFileLoader.java
Index: XmlFileLoader.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/metadata/XmlFileLoader.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XmlFileLoader.java 2000/10/24 23:16:27 1.6
+++ XmlFileLoader.java 2000/11/02 22:32:34 1.7
@@ -30,7 +30,7 @@
* @see <related>
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Wolfgang Werner</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class XmlFileLoader {
// Constants -----------------------------------------------------
@@ -90,7 +90,9 @@
// Load jbossdefault.xml from the default classLoader
// we always load defaults first
- URL defaultJbossUrl =
getClassLoader().getResource("standardjboss.xml");
+ // we use the context classloader, because this guy has to know where
+ // this file is
+ URL defaultJbossUrl =
Thread.currentThread().getContextClassLoader().getResource("standardjboss.xml");
if (defaultJbossUrl == null) {
throw new DeploymentException("no standardjboss.xml found");
@@ -121,8 +123,17 @@
// Protected -----------------------------------------------------
public static Document getDocument(URL url) throws DeploymentException {
+
+ try {
+ return getDocument (url.openStream());
+ } catch (IOException _ioe) {
+ throw new DeploymentException(_ioe.getMessage());
+ }
+ }
+
+ public static Document getDocument(InputStream _in) throws DeploymentException
{
try {
- Reader in = new InputStreamReader(url.openStream());
+ Reader in = new InputStreamReader(_in);
com.sun.xml.tree.XmlDocumentBuilder xdb = new
com.sun.xml.tree.XmlDocumentBuilder();
Parser parser = new com.sun.xml.parser.Parser();