private ClassLoader getParentClassLoader() throws GuacamoleException {

        // Retrieve lib directory
        File libDir = new File(environment.getGuacamoleHome(), LIB_DIRECTORY);

        // If lib directory does not exist, use default class loader
        if (!libDir.isDirectory())
            return ExtensionModule.class.getClassLoader();

        // Return classloader which loads classes from all .jars within the lib directory
        return new DirectoryClassLoader(libDir);

    }
Returns the classloader that should be used as the parent classloader
for all extensions. If the GUACAMOLE_HOME/lib directory exists, this
will be a classloader that loads classes from within the .jar files in
that directory. Lacking the GUACAMOLE_HOME/lib directory, this will
simply be the classloader associated with the ExtensionModule class.

@return
    The classloader that should be used as the parent classloader for
    all extensions.

@throws GuacamoleException
    If an error occurs while retrieving the classloader.
guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java