use of org.jboss.shrinkwrap.api.asset.ArchiveAsset in project wildfly-swarm by wildfly-swarm.
the class DefaultApplicationDeploymentProcessor method hasApplicationPathAnnotation.
static boolean hasApplicationPathAnnotation(ArchivePath path, Asset asset) {
if (asset == null) {
return false;
}
if (asset instanceof ArchiveAsset) {
return hasApplicationPathAnnotation(((ArchiveAsset) asset).getArchive());
}
if (!path.get().endsWith(".class")) {
return false;
}
try (InputStream in = asset.openStream()) {
ClassReader reader = new ClassReader(in);
ApplicationPathAnnotationSeekingClassVisitor visitor = new ApplicationPathAnnotationSeekingClassVisitor();
reader.accept(visitor, 0);
return visitor.isFound();
} catch (IOException ignored) {
}
return false;
}
Aggregations