use of org.jboss.modules.Resource in project wildfly-swarm by wildfly-swarm.
the class ManagementConsoleDeploymentProducer method managementConsoleWar.
@Produces
public Archive managementConsoleWar() throws Exception {
// Load the management-ui webjars.
WARArchive war = ShrinkWrap.create(WARArchive.class, "management-console-ui.war");
Module module = Module.getBootModuleLoader().loadModule("org.jboss.as.console");
Iterator<Resource> resources = module.globResources("*");
while (resources.hasNext()) {
Resource each = resources.next();
war.add(new UrlAsset(each.getURL()), each.getName());
}
war.setContextRoot(this.fraction.contextRoot());
return war;
}
use of org.jboss.modules.Resource in project jboss-modules by jboss-modules.
the class TestResourceLoader method getManifest.
private Manifest getManifest() throws IOException {
if (manifest != null)
return manifest;
final Resource manifestResource = getResource("META-INF/MANIFEST.MF");
if (manifestResource == null)
return null;
final InputStream manifestStream = manifestResource.openStream();
try {
manifest = new Manifest(manifestStream);
} finally {
if (manifestStream != null)
manifestStream.close();
}
return manifest;
}
Aggregations