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

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

      • success

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

        default void success​(java.io.File file,
                             java.util.Map<java.lang.String,​java.lang.String> attrs)
                      throws java.lang.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:
        java.lang.Exception - , are logged and ignored
      • failure

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

        boolean progress​(java.io.File file,
                         int percentage)
                  throws java.lang.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:
        java.lang.Exception - , are logged and ignored