use of org.jboss.shrinkwrap.api.asset.NamedAsset in project wildfly-swarm by wildfly-swarm.
the class WebXmlContainer method findWebXmlAsset.
/**
* Locate or create a {@code web.xml} asset.
*
* @return The existing or new {@code web.xml}.
*/
default WebXmlAsset findWebXmlAsset() {
final Node webXml = this.get(WebXmlAsset.NAME);
NamedAsset asset;
if (webXml == null) {
asset = new WebXmlAsset();
this.add(asset);
} else {
Asset tempAsset = webXml.getAsset();
if (!(tempAsset instanceof WebXmlAsset)) {
asset = new WebXmlAsset(tempAsset.openStream());
this.add(asset);
} else {
asset = (NamedAsset) tempAsset;
}
}
return (WebXmlAsset) asset;
}
Aggregations