public boolean isInstalled( final String canonicalName )
    {
        final DirectoryStream.Filter<Path> filter = entry -> {
            final String name = entry.getFileName().toString();
            return Files.exists(entry) && !Files.isDirectory(entry) &&
                (name.equalsIgnoreCase(canonicalName + ".jar") || name.equalsIgnoreCase(canonicalName + ".war"));
        };

        try ( final DirectoryStream<Path> paths = Files.newDirectoryStream( pluginDirectory, filter ) )
        {
            return paths.iterator().hasNext();
        }
        catch ( IOException e )
        {
            Log.error( "Unable to determine if plugin '{}' is installed.", canonicalName, e );

            // return the next best guess
            synchronized ( this )
            {
                return pluginsLoaded.containsKey(canonicalName);
            }
        }
    }
Returns true if the plugin by the specified name is installed. Specifically, this checks if the plugin
archive file is present in the {@code plugins} directory.

Note that an <em>installed</em> plugin is not per definition an <em>extracted</em> plugin, and an extracted
plugin is not per definition a <em>loaded</em> plugin.  A plugin that's extracted might, for instance, fail to
load, due to restrictions imposed by its {@code minServerVersion} definition.

@param canonicalName the canonical filename of the plugin (cannot be null).
@return true if the plugin is installed, otherwise false.
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginManager.java