Package aQute.bnd.service
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 TypeMethodDescriptionvoid
Called when the file could not be downloaded from a remote repository.boolean
Can be called back regularly before success/failure but never after.void
Called when the file is successfully downloaded from a remote repository.default void
Called when the file is successfully downloaded from a remote repository.
-
Method Details
-
success
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
Called when the file is successfully downloaded from a remote repository.- Parameters:
file
- The file that was downloadedattrs
- Additional attributes about the file. This may include maven coordinates.- Throws:
Exception
- , are logged and ignored
-
failure
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
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 downloadedpercentage
- 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
-