code: protected void downloadArtifactTo(URL artifactUrl, File pluginFile, IAsyncResultHandler<File> handler) {
          InputStream istream = null;
          OutputStream ostream = null;
          try {
              URLConnection connection = artifactUrl.openConnection();
              connection.connect();
              if (connection instanceof HttpURLConnection) {
                  HttpURLConnection httpConnection = (HttpURLConnection) connection;
                  if (httpConnection.getResponseCode() != 200) {
                      handler.handle(AsyncResultImpl.create(null));
                      return;
                  }
              }
              istream = connection.getInputStream();
              ostream = new FileOutputStream(pluginFile);
              IOUtils.copy(istream, ostream);
              ostream.flush();
              handler.handle(AsyncResultImpl.create(pluginFile));
          } catch (Exception e) {
              handler.handle(AsyncResultImpl.<File>create(e));
          } finally {
              IOUtils.closeQuietly(istream);
              IOUtils.closeQuietly(ostream);
          }
      }
docs: Download the artifact at the given URL and store it locally into the given
  plugin file path.