@Override protected URL getDefaultConfigFile(String defaultConfigFileName) { URL url = implementorClass.getResource("/" + defaultConfigFileName); if (url == null) { UnifiedVirtualFile vf = deploymentRoot.findChildFailSafe(defaultConfigFileName); if (vf != null) { url = vf.toURL(); } } return url; }
/** Unmrashall the webservices.xml if there is one */ protected WebservicesMetaData getWebservicesMetaData(DeploymentInfo unit, String wsFile) { WebservicesMetaData wsMetaData = (WebservicesMetaData)unit.context.get(WebservicesMetaData.class); UnifiedVirtualFile vfWebservices = getWebservicesFile(unit, wsFile); if (wsMetaData == null && vfWebservices != null) { try { URL wsURL = vfWebservices.toURL(); Element root = DOMUtils.parse(wsURL.openStream()); String namespaceURI = root.getNamespaceURI(); if (namespaceURI.equals("http://java.sun.com/xml/ns/j2ee")) { Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); ObjectModelFactory factory = new WebservicesFactory(wsURL); wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(wsURL.openStream(), factory, null); unit.context.put(WebservicesMetaData.class, wsMetaData); } } catch (Exception ex) { throw new WSFDeploymentException(ex); } } return wsMetaData; }
private UnifiedVirtualFile getWebservicesFile(DeploymentInfo unit, String wsFile) { try { UnifiedVirtualFile vfsRoot = new ResourceLoaderAdapter(unit.localCl); return (wsFile != null ? vfsRoot.findChild(wsFile) : null); } catch (IOException e) { return null; } } }
/** Unmrashall the webservices.xml if there is one */ protected WebservicesMetaData getWebservicesMetaData(DeploymentInfo unit, String wsFile) { WebservicesMetaData wsMetaData = (WebservicesMetaData)unit.context.get(WebservicesMetaData.class); UnifiedVirtualFile vfWebservices = getWebservicesFile(unit, wsFile); if (wsMetaData == null && vfWebservices != null) { try { URL wsURL = vfWebservices.toURL(); Element root = DOMUtils.parse(wsURL.openStream()); String namespaceURI = root.getNamespaceURI(); if (namespaceURI.equals("http://java.sun.com/xml/ns/j2ee")) { Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); ObjectModelFactory factory = new WebservicesFactory(wsURL); wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(wsURL.openStream(), factory, null); unit.context.put(WebservicesMetaData.class, wsMetaData); } } catch (Exception ex) { throw new WSFDeploymentException(ex); } } return wsMetaData; }
private UnifiedVirtualFile getWebservicesFile(DeploymentInfo unit, String wsFile) { try { UnifiedVirtualFile vfsRoot = new ResourceLoaderAdapter(unit.localCl); return (wsFile != null ? vfsRoot.findChild(wsFile) : null); } catch (IOException e) { return null; } } }
/** Unmrashall the webservices.xml if there is one */ protected WebservicesMetaData getWebservicesMetaData(DeploymentInfo unit, String wsFile) { WebservicesMetaData wsMetaData = (WebservicesMetaData)unit.context.get(WebservicesMetaData.class); UnifiedVirtualFile vfWebservices = getWebservicesFile(unit, wsFile); if (wsMetaData == null && vfWebservices != null) { try { URL wsURL = vfWebservices.toURL(); Element root = DOMUtils.parse(wsURL.openStream()); String namespaceURI = root.getNamespaceURI(); if (namespaceURI.equals("http://java.sun.com/xml/ns/j2ee")) { Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); ObjectModelFactory factory = new WebservicesFactory(wsURL); wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(wsURL.openStream(), factory, null); unit.context.put(WebservicesMetaData.class, wsMetaData); } } catch (Exception ex) { throw new WSFDeploymentException(ex); } } return wsMetaData; }
/** * Load jboss-webservices.xml from <code>META-INF/jboss-webservices.xml</code> or <code>WEB-INF/jboss-webservices.xml</code> * . * * @param root virtual file root * @return JBossWebservicesMetaData or <code>null</code> if it cannot be found */ public JBossWebservicesMetaData loadFromVFSRoot(final UnifiedVirtualFile root) { JBossWebservicesMetaData webservices = null; UnifiedVirtualFile wsdd = root.findChildFailSafe("META-INF/jboss-webservices.xml"); // Maybe a web application deployment? if (null == wsdd) { wsdd = root.findChildFailSafe("WEB-INF/jboss-webservices.xml"); } // the descriptor is optional if (wsdd != null) { return load(wsdd.toURL()); } return webservices; }
private UnifiedVirtualFile getWebservicesFile(DeploymentInfo unit, String wsFile) { try { UnifiedVirtualFile vfsRoot = new ResourceLoaderAdapter(unit.localCl); return (wsFile != null ? vfsRoot.findChild(wsFile) : null); } catch (IOException e) { return null; } } }
/** Unmrashall the webservices.xml if there is one */ protected WebservicesMetaData getWebservicesMetaData(DeploymentUnit unit) { WebservicesMetaData wsMetaData = unit.getAttachment(WebservicesMetaData.class); UnifiedVirtualFile vfWebservices = getWebservicesFile(unit); if (wsMetaData == null && vfWebservices != null) { try { URL wsURL = vfWebservices.toURL(); Element root = DOMUtils.parse(wsURL.openStream()); String namespaceURI = root.getNamespaceURI(); if (namespaceURI.equals("http://java.sun.com/xml/ns/j2ee")) { Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); ObjectModelFactory factory = new WebservicesFactory(wsURL); wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(wsURL.openStream(), factory, null); unit.addAttachment(WebservicesMetaData.class, wsMetaData); } } catch (Exception ex) { throw new WSFDeploymentException(ex); } } return wsMetaData; }
/** * Load webservices.xml from <code>META-INF/webservices.xml</code> * or <code>WEB-INF/webservices.xml</code>. * * @param root virtual file root * @return WebservicesMetaData or <code>null</code> if it cannot be found */ public WebservicesMetaData loadFromVFSRoot(UnifiedVirtualFile root) { WebservicesMetaData webservices = null; UnifiedVirtualFile wsdd = root.findChildFailSafe("META-INF/webservices.xml"); // Maybe a web application deployment? if (null == wsdd) { wsdd = root.findChildFailSafe("WEB-INF/webservices.xml"); } // the descriptor is optional if (wsdd != null) { return load(wsdd.toURL()); } return webservices; }
/** Unmrashall the webservices.xml if there is one */ protected WebservicesMetaData getWebservicesMetaData(DeploymentUnit unit) { WebservicesMetaData wsMetaData = unit.getAttachment(WebservicesMetaData.class); UnifiedVirtualFile vfWebservices = getWebservicesFile(unit); if (wsMetaData == null && vfWebservices != null) { try { URL wsURL = vfWebservices.toURL(); Element root = DOMUtils.parse(wsURL.openStream()); String namespaceURI = root.getNamespaceURI(); if (namespaceURI.equals("http://java.sun.com/xml/ns/j2ee")) { Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); ObjectModelFactory factory = new WebservicesFactory(wsURL); wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(wsURL.openStream(), factory, null); unit.addAttachment(WebservicesMetaData.class, wsMetaData); } } catch (Exception ex) { throw new WSFDeploymentException(ex); } } return wsMetaData; }
UnifiedVirtualFile vfResource = rootFile.findChildFailSafe(resourcePath); if (vfResource == null) resourceURL = vfResource.toURL(); URL wsdlUrl = uvf.toURL(); String wsdlPath = wsdlUrl.getPath(); if (wsdlPath.startsWith("/")) vfResource = uvf.findChildFailSafe(resourcePath); if (traceEnabled && vfResource == null) { ROOT_LOGGER.cannotGetRootResourceFrom(resourcePath, uvf, null); resourceURL = vfResource.toURL();
/** Unmrashall the webservices.xml if there is one */ protected WebservicesMetaData getWebservicesMetaData(DeploymentUnit unit) { WebservicesMetaData wsMetaData = unit.getAttachment(WebservicesMetaData.class); UnifiedVirtualFile vfWebservices = getWebservicesFile(unit); if (wsMetaData == null && vfWebservices != null) { try { URL wsURL = vfWebservices.toURL(); Element root = DOMUtils.parse(wsURL.openStream()); String namespaceURI = root.getNamespaceURI(); if (namespaceURI.equals("http://java.sun.com/xml/ns/j2ee")) { Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); ObjectModelFactory factory = new WebservicesFactory(wsURL); wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(wsURL.openStream(), factory, null); unit.addAttachment(WebservicesMetaData.class, wsMetaData); } } catch (Exception ex) { throw new WSFDeploymentException(ex); } } return wsMetaData; }
UnifiedVirtualFile vfs = archive.getRootFile().findChildFailSafe(META_INF_JAXB_INTROS_XML); if (vfs != null) { url = vfs.toURL(); introsConfigStream = url.openStream(); UnifiedVirtualFile vfs = archive.getRootFile().findChildFailSafe(WEB_INF_JAXB_INTROS_XML); if (vfs != null) { url = vfs.toURL(); introsConfigStream = url.openStream();
public URL getMappingLocation() { URL mappingURL = null; if (mappingFile != null) { if (vfsRoot != null) { try { mappingURL = vfsRoot.findChild(mappingFile).toURL(); } catch (Exception e) { throw MESSAGES.cannotFindFile(e, mappingFile); } } else { mappingURL = getContextClassLoader().getResource(mappingFile); } } return mappingURL; }