xml.append("\n"); formatNode( ((ArchiveAsset)node.getAsset()).getArchive().get(ArchivePaths.root()), xml); xml.append("</asset>").append("\n");
xml.append("\n"); formatNode( ((ArchiveAsset)node.getAsset()).getArchive().get(ArchivePaths.root()), xml); xml.append("</asset>").append("\n");
Map<ArchivePath, Node> classes = nestedArchive.getArchive().getContent(Filters.include(".*\\.class")); for(Map.Entry<ArchivePath, Node> classEntry : classes.entrySet())
Map<ArchivePath, Node> classes = nestedArchive.getArchive().getContent(Filters.include(".*/beans.xml")); for(final Map.Entry<ArchivePath, Node> entry : classes.entrySet())
private boolean containsBeansXML(Archive<?> archive) { Map<ArchivePath, Node> content = archive.getContent(Filters.include(".*/beans\\.xml")); if(!content.isEmpty()) { return true; } Map<ArchivePath, Node> nested = archive.getContent(Filters.include("/.*\\.(jar|war)")); if(!nested.isEmpty()) { for(Node node : nested.values()) { if(node.getAsset() instanceof ArchiveAsset ) { boolean containsBeansXML = containsBeansXML( ((ArchiveAsset)node.getAsset()).getArchive()); if(containsBeansXML) { return true; } } } } return false; } }
/** * {@inheritDoc} * @see org.glassfish.api.deployment.archive.ReadableArchive#getSubArchive(java.lang.String) */ // TODO: We should support non ShrinkWrap nested Archives as well. ie: external jar files. @Override public ReadableArchive getSubArchive(String path) throws IOException { final Node archiveNode = this.getArchive().get(ArchivePaths.create(path)); if (archiveNode.getAsset() instanceof ArchiveAsset) { return ((ArchiveAsset) archiveNode.getAsset()).getArchive().as(ShrinkwrapReadableArchive.class); } throw new IOException(path + " not a Archive"); }
warArchiveAsset.getArchive().as(WebArchive.class), new ArrayList<Archive<?>>(), // reuse the War handling, but Auxiliary Archives should be added to the EAR, not the WAR protocol,
warArchiveAsset.getArchive().as(WebArchive.class), new ArrayList<Archive<?>>(), // reuse the War handling, but Auxiliary Archives should be added to the EAR, not the WAR protocol,