VisitorAttributes va = new VisitorAttributes();
va.setLeavesOnly(true);
ClassFileFilter filter = new ClassFileFilter();
SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
va.setRecurseFilter(noJars);
FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
for (VirtualFile vf : unit.getClassPath())
{
try
{
vf.visit(visitor);
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
return visitor.getMatched();
}