Package com.biglybt.ui.swt.update
Class UpdateAutoDownloader
- java.lang.Object
-
- com.biglybt.ui.swt.update.UpdateAutoDownloader
-
- All Implemented Interfaces:
ResourceDownloaderListener
public class UpdateAutoDownloader extends java.lang.Object implements ResourceDownloaderListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
UpdateAutoDownloader.cbCompletion
-
Field Summary
Fields Modifier and Type Field Description private UpdateAutoDownloader.cbCompletion
completionCallback
private java.util.ArrayList
downloaders
private java.util.Iterator
iterDownloaders
private Update[]
updates
-
Constructor Summary
Constructors Constructor Description UpdateAutoDownloader(Update[] updates, UpdateAutoDownloader.cbCompletion completionCallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
allDownloadsComplete()
boolean
completed(ResourceDownloader downloader, java.io.InputStream data)
void
failed(ResourceDownloader downloader, ResourceDownloaderException e)
private boolean
nextUpdate()
void
reportActivity(ResourceDownloader downloader, java.lang.String activity)
void
reportAmountComplete(ResourceDownloader downloader, long amount)
void
reportPercentComplete(ResourceDownloader downloader, int percentage)
private void
start()
-
-
-
Field Detail
-
updates
private final Update[] updates
-
downloaders
private java.util.ArrayList downloaders
-
iterDownloaders
private java.util.Iterator iterDownloaders
-
completionCallback
private final UpdateAutoDownloader.cbCompletion completionCallback
-
-
Constructor Detail
-
UpdateAutoDownloader
public UpdateAutoDownloader(Update[] updates, UpdateAutoDownloader.cbCompletion completionCallback)
- Parameters:
us
-
-
-
Method Detail
-
start
private void start()
-
nextUpdate
private boolean nextUpdate()
- Since:
- 3.0.0.7
-
allDownloadsComplete
private void allDownloadsComplete()
- Since:
- 3.0.0.7
-
completed
public boolean completed(ResourceDownloader downloader, java.io.InputStream data)
- Specified by:
completed
in interfaceResourceDownloaderListener
- Returns:
- return true if the completed download is OK. If false is returned then if there are alternative download sources they will be tried. If there are no other sources then the download will be "failed"
-
failed
public void failed(ResourceDownloader downloader, ResourceDownloaderException e)
- Specified by:
failed
in interfaceResourceDownloaderListener
-
reportActivity
public void reportActivity(ResourceDownloader downloader, java.lang.String activity)
- Specified by:
reportActivity
in interfaceResourceDownloaderListener
-
reportAmountComplete
public void reportAmountComplete(ResourceDownloader downloader, long amount)
- Specified by:
reportAmountComplete
in interfaceResourceDownloaderListener
-
reportPercentComplete
public void reportPercentComplete(ResourceDownloader downloader, int percentage)
- Specified by:
reportPercentComplete
in interfaceResourceDownloaderListener
-
-