use of org.flywaydb.core.internal.scanner.classpath.ClassPathScanner in project flyway by flyway.
the class ClasspathClassScanner method scanForType.
public List<String> scanForType(String location, Class<?> classType, boolean errorOnNotFound) {
ClassPathScanner<?> s = new ClassPathScanner<>(classType, classLoader, Charset.defaultCharset(), new Location("classpath:" + location), resourceNameCache, locationScannerCache, errorOnNotFound);
List<String> discoveredTypes = new ArrayList<>();
for (LoadableResource resource : s.scanForResources()) {
if (resource.getAbsolutePath().endsWith(".class")) {
discoveredTypes.add(toClassName(resource.getAbsolutePath()));
}
}
return discoveredTypes;
}
Aggregations