public boolean downloadPlugin(String url) {
        boolean installed = false;
        // Download and install new version of plugin
        if (isKnownPlugin(url)) {
            final HttpGet httpGet = new HttpGet(url);

            try (final CloseableHttpClient httpClient = HttpClients.custom().setRoutePlanner(getRoutePlanner()).build();
                 final CloseableHttpResponse response = httpClient.execute(httpGet)) {
                final int statusCode = response.getStatusLine().getStatusCode();
                if (statusCode == HttpStatus.SC_OK) {
                    String pluginFilename = url.substring(url.lastIndexOf("/") + 1);
                    installed = XMPPServer.getInstance().getPluginManager()
                        .installPlugin(response.getEntity().getContent(), pluginFilename);
                    if (installed) {
                        // Remove the plugin from the list of plugins to update
                        for (Update update : pluginUpdates) {
                            if (update.getURL().equals(url)) {
                                update.setDownloaded(true);
                            }
                        }
                        // Save response in a file for later retrieval
                        saveLatestServerInfo();
                    }
                }
            } catch (IOException e) {
                Log.warn("Error downloading new plugin version", e);
            }
        } else {
            Log.error("Invalid plugin download URL: " +url);
        }
        return installed;
    }
Download and install latest version of plugin.

@param url the URL of the latest version of the plugin.
@return true if the plugin was successfully downloaded and installed.
xmppserver/src/main/java/org/jivesoftware/openfire/update/UpdateManager.java