public static String getCanonicalName( Path pluginPath )
    {
        final String pathFileName = pluginPath.getFileName().toString().toLowerCase();
        if ( pluginPath.toFile().isDirectory() )
        {
            return pathFileName;
        }
        else
        {
            // Strip file extension
            return pathFileName.substring( 0, pathFileName.lastIndexOf( '.' ) );
        }
    }
Returns the canonical name for the plugin, derived from the plugin directory or archive file name.

The provided path can refer to either the plugin archive file, or the directory in which the archive was
extracted.

Note that this value can be different from the 'human readable' plugin name, as returned by {@link #getName(Path)}.

@param pluginPath the path of the plugin directory, or plugin archive file.
@return the plugin's canonical name.
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginMetadataHelper.java