diff --git a/src/main/java/org/cryptomator/integrations/common/ClassLoaderFactory.java b/src/main/java/org/cryptomator/integrations/common/ClassLoaderFactory.java index 922bcb1..50b29c2 100644 --- a/src/main/java/org/cryptomator/integrations/common/ClassLoaderFactory.java +++ b/src/main/java/org/cryptomator/integrations/common/ClassLoaderFactory.java @@ -23,7 +23,7 @@ class ClassLoaderFactory { /** * Attempts to find {@code .jar} files in the path specified in {@value #PLUGIN_DIR_KEY} system property. - * A new class loader instance is returned that loads classes from the given classes. + * A new class loader instance is returned that loads classes from the given directory. * * @return A new URLClassLoader that is aware of all {@code .jar} files in the plugin dir */ diff --git a/src/main/java/org/cryptomator/integrations/common/IntegrationsLoader.java b/src/main/java/org/cryptomator/integrations/common/IntegrationsLoader.java index c0f5116..92f5a9d 100644 --- a/src/main/java/org/cryptomator/integrations/common/IntegrationsLoader.java +++ b/src/main/java/org/cryptomator/integrations/common/IntegrationsLoader.java @@ -23,6 +23,14 @@ public class IntegrationsLoader { private IntegrationsLoader() { } + private static class PluginClassLoaderHolder { + private static final ClassLoader CLASS_LOADER = ClassLoaderFactory.forPluginDir(); + } + + private static ClassLoader getClassLoader() { + return PluginClassLoaderHolder.CLASS_LOADER; + } + /** * Loads the best suited service provider, i.e. the one with the highest priority that is supported. *
@@ -44,7 +52,7 @@ public static