class BasePluginLoader implements PluginLoader {

    protected PluginManager pluginManager;
    protected PluginClasspath pluginClasspath;

    public BasePluginLoader(PluginManager pluginManager, PluginClasspath pluginClasspath) {
        this.pluginManager = pluginManager;
        this.pluginClasspath = pluginClasspath;
    }

    @Override
    public boolean isApplicable(Path pluginPath) {
        return Files.exists(pluginPath);
    }

    @Override
    public ClassLoader loadPlugin(Path pluginPath, PluginDescriptor pluginDescriptor) {
        PluginClassLoader pluginClassLoader = createPluginClassLoader(pluginPath, pluginDescriptor);

        loadClasses(pluginPath, pluginClassLoader);
        loadJars(pluginPath, pluginClassLoader);

        return pluginClassLoader;
    }

    protected PluginClassLoader createPluginClassLoader(Path pluginPath, PluginDescriptor pluginDescriptor) {
        return new PluginClassLoader(pluginManager, pluginDescriptor, getClass().getClassLoader());
    }

    /**
     * Add all {@code *.class} files from {@link PluginClasspath#getClassesDirectories()}
     * to the plugin's {@link ClassLoader}.
     */
    protected void loadClasses(Path pluginPath, PluginClassLoader pluginClassLoader) {
        for (String directory : pluginClasspath.getClassesDirectories()) {
            File file = pluginPath.resolve(directory).toFile();
            if (file.exists() && file.isDirectory()) {
                pluginClassLoader.addFile(file);
            }
        }
    }

    /**
     * Add all {@code *.jar} files from {@link PluginClasspath#getJarsDirectories()}
     * to the plugin's {@link ClassLoader}.
     */
    protected void loadJars(Path pluginPath, PluginClassLoader pluginClassLoader) {<FILL_FUNCTION_BODY>}

}

        for (String jarsDirectory : pluginClasspath.getJarsDirectories()) {
            Path file = pluginPath.resolve(jarsDirectory);
            List<File> jars = FileUtils.getJars(file);
            for (File jar : jars) {
                pluginClassLoader.addFile(jar);
            }
        }
    
<no_super_class>