Search in sources :

Example 1 with JarExplorer

use of org.mule.runtime.module.artifact.internal.util.JarExplorer in project mule by mulesoft.

the class IsolatedClassLoaderFactory method getLibraryPackages.

private JarInfo getLibraryPackages(List<URL> libraries) {
    Set<String> packages = new HashSet<>();
    Set<String> resources = new HashSet<>();
    final JarExplorer jarExplorer = new FileJarExplorer();
    for (URL library : libraries) {
        try {
            JarInfo jarInfo = jarExplorer.explore(library.toURI());
            packages.addAll(jarInfo.getPackages());
            resources.addAll(jarInfo.getResources());
        } catch (URISyntaxException e) {
            throw new MuleRuntimeException(e);
        }
    }
    return new JarInfo(packages, resources);
}
Also used : JarExplorer(org.mule.runtime.module.artifact.internal.util.JarExplorer) FileJarExplorer(org.mule.runtime.module.artifact.internal.util.FileJarExplorer) FileJarExplorer(org.mule.runtime.module.artifact.internal.util.FileJarExplorer) JarInfo(org.mule.runtime.module.artifact.internal.util.JarInfo) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) URISyntaxException(java.net.URISyntaxException) URL(java.net.URL) HashSet(java.util.HashSet)

Aggregations

URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 HashSet (java.util.HashSet)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 FileJarExplorer (org.mule.runtime.module.artifact.internal.util.FileJarExplorer)1 JarExplorer (org.mule.runtime.module.artifact.internal.util.JarExplorer)1 JarInfo (org.mule.runtime.module.artifact.internal.util.JarInfo)1