protected Path downloadPlugin(String id, String version) throws PluginException {
        try {
            PluginRelease release = findReleaseForPlugin(id, version);
            Path downloaded = getFileDownloader(id).downloadFile(new URL(release.url));
            getFileVerifier(id).verify(new FileVerifier.Context(id, release), downloaded);
            return downloaded;
        } catch (IOException e) {
            throw new PluginException(e, "Error during download of plugin {}", id);
        }
    }
protected Path downloadPlugin ( String id , String version ) throws PluginException { try { PluginRelease release = findReleaseForPlugin ( id , version ) ; Path downloaded = getFileDownloader ( id ) . downloadFile ( new URL ( release . url ) ) ; getFileVerifier ( id ) . verify ( new FileVerifier . Context ( id , release ) , downloaded ) ; return downloaded ; } catch ( IOException e ) { throw new PluginException ( e , "Error during download of plugin {}" , id ) ; } }
Downloads a plugin with given coordinates, runs all {@link FileVerifier}s
and returns a path to the downloaded file.

@param id of plugin
@param version of plugin or null to download latest
@return Path to file which will reside in a temporary folder in the system default temp area
@throws PluginException if download failed