use of org.hibernate.ejb.packaging.NamedInputStream in project wildfly by wildfly.
the class HibernateAnnotationScanner method findFiles.
private void findFiles(URL jarToScan, Set<String> filePatterns, Map<String, Set<NamedInputStream>> map, Set<NamedInputStream> result) {
if (filePatterns.isEmpty()) {
for (Set<NamedInputStream> nims : map.values()) result.addAll(nims);
} else {
VirtualFile root = null;
for (String pattern : filePatterns) {
Set<NamedInputStream> niss = map.get(pattern);
if (niss == null) {
if (root == null)
root = getFile(jarToScan);
try {
List<VirtualFile> children = root.getChildrenRecursively(new HibernatePatternFilter(pattern));
niss = toNIS(children);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
if (niss != null)
result.addAll(niss);
}
}
}
use of org.hibernate.ejb.packaging.NamedInputStream in project wildfly by wildfly.
the class HibernateAnnotationScanner method toNIS.
private Set<NamedInputStream> toNIS(Iterable<VirtualFile> files) {
Set<NamedInputStream> result = new HashSet<NamedInputStream>();
for (VirtualFile file : files) {
NamedInputStream nis = new HibernateVirtualFileNamedInputStream(file);
result.add(nis);
}
return result;
}
Aggregations