Interface RepositoryPlugin.DownloadListener

All Known Implementing Classes:
DownloadBlocker
Enclosing interface:
RepositoryPlugin

public static interface RepositoryPlugin.DownloadListener
The caller can specify any number of DownloadListener objects that are called back when a download is finished (potentially before the get method has returned).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    failure(File file, String reason)
    Called when the file could not be downloaded from a remote repository.
    boolean
    progress(File file, int percentage)
    Can be called back regularly before success/failure but never after.
    void
    success(File file)
    Called when the file is successfully downloaded from a remote repository.
    default void
    success(File file, Map<String,String> attrs)
    Called when the file is successfully downloaded from a remote repository.
  • Method Details

    • success

      void success(File file) throws Exception
      Called when the file is successfully downloaded from a remote repository.
      Parameters:
      file - The file that was downloaded
      Throws:
      Exception - , are logged and ignored
    • success

      default void success(File file, Map<String,String> attrs) throws Exception
      Called when the file is successfully downloaded from a remote repository.
      Parameters:
      file - The file that was downloaded
      attrs - Additional attributes about the file. This may include maven coordinates.
      Throws:
      Exception - , are logged and ignored
    • failure

      void failure(File file, String reason) throws Exception
      Called when the file could not be downloaded from a remote repository.
      Parameters:
      file - The file that was intended to be downloaded.
      Throws:
      Exception - , are logged and ignored
    • progress

      boolean progress(File file, int percentage) throws Exception
      Can be called back regularly before success/failure but never after. Indicates how far the download has progressed in percents. Since downloads can be restarted, it is possible that the percentage decreases.
      Parameters:
      file - The file that was intended to be downloaded
      percentage - Percentage of file downloaded (can go down)
      Returns:
      true if the download should continue, fails if it should be canceled (and fail)
      Throws:
      Exception - , are logged and ignored