|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectaQute.bnd.build.DownloadBlocker
public class DownloadBlocker
This class is intended to be used by the users of a RepositoryPlugin.
The
RepositoryPlugin.get(String, aQute.bnd.version.Version, java.util.Map, aQute.bnd.service.RepositoryPlugin.DownloadListener...)
method takes one or more Download Listeners. These are called back with the
success or failure of a download. This class is a simple implementation of
this model, just call getReason() and it blocks until success or
failure is called.
| Nested Class Summary | |
|---|---|
static class |
DownloadBlocker.Stage
|
| Constructor Summary | |
|---|---|
DownloadBlocker(Reporter reporter)
|
|
| Method Summary | |
|---|---|
void |
failure(File file,
String reason)
Called when the file could not be downloaded from a remote repository. |
File |
getFile()
|
String |
getReason()
Return a failure reason or null. |
DownloadBlocker.Stage |
getStage()
Return the stage we're in |
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. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DownloadBlocker(Reporter reporter)
| Method Detail |
|---|
public void success(File file)
throws Exception
RepositoryPlugin.DownloadListener
success in interface RepositoryPlugin.DownloadListenerfile - The file that was downloaded
Exception - , are logged and ignored
public void failure(File file,
String reason)
throws Exception
RepositoryPlugin.DownloadListener
failure in interface RepositoryPlugin.DownloadListenerfile - The file that was intended to be downloaded.
Exception - , are logged and ignored
public boolean progress(File file,
int percentage)
throws Exception
RepositoryPlugin.DownloadListener
progress in interface RepositoryPlugin.DownloadListenerfile - The file that was intended to be downloadedpercentage - Percentage of file downloaded (can go down)
Exception - , are logged and ignoredpublic String getReason()
success(File) or failure(File, String) has been called.
It can be called many times.
public DownloadBlocker.Stage getStage()
public File getFile()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||