/** Invokes getDocument(url, defaultValidateDTDs) * */ public static Document getDocument(URL url) throws DeploymentException { return getDocument(url, defaultValidateDTDs); }
/** Get the xml file from the URL and parse it into a Document object. * Calls getDocument(new InputSource(url.openStream()), url.getPath()) * with the InputSource.SystemId set to url.toExternalForm(). * * @param url the URL from which the xml doc is to be obtained. * @return Document */ public Document getDocumentFromURL(URL url) throws DeploymentException { InputStream is = null; try { is = url.openStream(); return getDocument(is, url.toExternalForm()); } catch (IOException e) { throw new DeploymentException("Failed to obtain xml doc from URL", e); } }
try doc = getDocument(is2, inPath);
public void startService() throws Exception { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); URL stdJDBCUrl = classLoader.getResource("standardjbosscmp-jdbc.xml"); if(stdJDBCUrl == null) { throw new DeploymentException("No standardjbosscmp-jdbc.xml found"); } boolean debug = log.isDebugEnabled(); if(debug) { log.debug("Loading standardjbosscmp-jdbc.xml : " + stdJDBCUrl.toString()); } Element stdJDBCElement = XmlFileLoader.getDocument(stdJDBCUrl, true).getDocumentElement(); Element typeMaps = MetaData.getOptionalChild(stdJDBCElement, "type-mappings"); if(typeMaps != null) { for(Iterator i = MetaData.getChildrenByTagName(typeMaps, "type-mapping"); i.hasNext();) { Element typeMappingElement = (Element)i.next(); JDBCTypeMappingMetaData typeMapping = new JDBCTypeMappingMetaData(typeMappingElement); typeMappings.put(typeMapping.getName(), typeMapping); log.debug("added type-mapping: " + typeMapping.getName()); } } }
try { if (webIS != null) { Document webDoc = xmlLoader.getDocument(webIS, warURI + "/WEB-INF/web.xml"); Element web = webDoc.getDocumentElement(); Document jbossWebDoc = xmlLoader.getDocument(jbossWebIS, warURI + "/WEB-INF/jboss-web.xml"); Element jbossWeb = jbossWebDoc.getDocumentElement();
if (debug) log.debug("Loading standardjbosscmp-jdbc.xml : " + stdJDBCUrl.toString()); Element stdJDBCElement = XmlFileLoader.getDocument(stdJDBCUrl, true).getDocumentElement(); Element jdbcElement = XmlFileLoader.getDocument(jdbcUrl, true).getDocumentElement(); jamd = new JDBCApplicationMetaData(jdbcElement, jamd);