private List<Extension> getExtensions() {

        // Retrieve and validate extensions directory
        File extensionsDir = new File(environment.getGuacamoleHome(), EXTENSIONS_DIRECTORY);
        if (!extensionsDir.isDirectory())
            return Collections.emptyList();

        // Retrieve list of all extension files within extensions directory
        File[] extensionFiles = extensionsDir.listFiles(new FileFilter() {

            @Override
            public boolean accept(File file) {
                return file.isFile() && file.getName().endsWith(EXTENSION_SUFFIX);
            }

        });

        // Verify contents are accessible
        if (extensionFiles == null) {
            logger.warn("Although GUACAMOLE_HOME/" + EXTENSIONS_DIRECTORY + " exists, its contents cannot be read.");
            return Collections.emptyList();
        }

        // Read (but do not fully load) each extension within the extension
        // directory
        List<Extension> extensions = new ArrayList<>(extensionFiles.length);
        for (File extensionFile : extensionFiles) {

            logger.debug("Reading extension: \"{}\"", extensionFile.getName());

            try {

                // Load extension from file
                Extension extension = new Extension(getParentClassLoader(), extensionFile, temporaryFiles);

                // Validate Guacamole version of extension
                if (!isCompatible(extension.getGuacamoleVersion())) {
                    logger.debug("Declared Guacamole version \"{}\" of extension \"{}\" is not compatible with this version of Guacamole.",
                            extension.getGuacamoleVersion(), extensionFile.getName());
                    throw new GuacamoleServerException("Extension \"" + extension.getName() + "\" is not "
                            + "compatible with this version of Guacamole.");
                }

                extensions.add(extension);

            }
            catch (GuacamoleException e) {
                logger.error("Extension \"{}\" could not be loaded: {}", extensionFile.getName(), e.getMessage());
                logger.debug("Unable to load extension.", e);
            }

        }

        extensions.sort(getExtensionLoadOrder());
        return extensions;

    }
Returns a list of all installed extensions in the order they should be
loaded. Extension load order is dictated by the "extension-priority"
property and by extension filename. Each extension within
GUACAMOLE_HOME/extensions is read and validated, but not fully loaded.
It is the responsibility of the caller to continue the load process with
the extensions in the returned list.

@return
    A list of all installed extensions, ordered by load priority.
guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java