liquibase-core/src/main/java/liquibase/servicelocator/DefaultPackageScanClassResolver.java
private void loadImplementationsInDirectory(String parent, File location, ClassLoader classLoader) {
        Set<String> classFiles = classFilesByLocation.get(location.toString());
        if (classFiles == null) {
            classFiles = new HashSet<String>();

            File[] files = location.listFiles();
            StringBuilder builder = null;

            for (File file : files) {
                builder = new StringBuilder(100);
                String name = file.getName();
                if (name != null) {
                    name = name.trim();
                    builder.append(parent).append("/").append(name);
                    String packageOrClass = (parent == null) ? name : builder.toString();

                    if (file.isDirectory()) {
                        loadImplementationsInDirectory(packageOrClass, file, classLoader);
                    } else if (name.endsWith(".class")) {
                        classFiles.add(packageOrClass);
                    }
                }
            }
        }

        for (String packageOrClass : classFiles) {
            this.loadClass(packageOrClass, classLoader);
        }
    }
private void loadImplementationsInDirectory(String parent, File location, ClassLoader classLoader) {
        Set<String> classFiles = classFilesByLocation.get(location.toString());
        if (classFiles == null) {
            classFiles = new HashSet<String>();

            File[] files = location.listFiles();
            StringBuilder builder = null;

            for (File file : files) {
                builder = new StringBuilder(100);
                String name = file.getName();
                if (name != null) {
                    name = name.trim();
                    builder.append(parent).append("/").append(name);
                    String packageOrClass = (parent == null) ? name : builder.toString();

                    if (file.isDirectory()) {
                        loadImplementationsInDirectory(packageOrClass, file, classLoader);
                    } else if (name.endsWith(".class")) {
                        classFiles.add(packageOrClass);
                    }
                }
            }
        }

        for (String packageOrClass : classFiles) {
            this.loadClass(packageOrClass, classLoader);
        }
    }
Finds matches in a physical directory on a filesystem. Examines all files
within a directory - if the File object is not a directory, and ends with
<i>.class</i> the file is loaded. Operates recursively to find classes within a
folder structure matching the package structure.

@param parent   the package name up to this directory in the package
hierarchy. E.g. if /classes is in the classpath and we wish to
examine files in /classes/org/apache then the values of
<i>parent</i> would be <i>org/apache</i>
@param location a File object representing a directory