cz.polous.andaria
Class Downloader

java.lang.Object
  extended by cz.polous.andaria.ProgressBar
      extended by cz.polous.andaria.PatcherQueue
          extended by cz.polous.andaria.Downloader
All Implemented Interfaces:
java.lang.Runnable

 class Downloader
extends PatcherQueue

Downloader se stara o stahovani souboru. Po uspesnem stazeni presune soubor do fronty installeru a spusti installer. Trida umoznuje pouze jednu instanci (singleton) Class is singleton.

Author:
Martin Polehla (andaria_patcher@polous.cz)

Nested Class Summary
 
Nested classes/interfaces inherited from class cz.polous.andaria.ProgressBar
ProgressBar.BARS
 
Field Summary
private static Downloader INSTANCE
           
 
Fields inherited from class cz.polous.andaria.PatcherQueue
log, patchQueue
 
Constructor Summary
private Downloader()
          Creates a new instance of Downloader
 
Method Summary
protected  void addPatchItem(PatchItem p)
          Add new PatchItem to queue.
(package private)  void executeNext()
          Main download procedure - Set total size of install object to same like download size.
private  void finishDownload(PatchItem p)
          Finish download procedure - update download status - add item to install queue and run Installer - remove downlaoded file from download queue
static Downloader getInstance()
           
 
Methods inherited from class cz.polous.andaria.PatcherQueue
cancel, canceled, getFirstItem, inProgress, isFinished, notCanceled, pause, removeFirst, reset, run, start, startSafe
 
Methods inherited from class cz.polous.andaria.ProgressBar
getSingleMax, getSingleProgress, getSpeedLabelText, getTotalMax, getTotalProgress, removeFromTotalProgress, resetProgressBar, resetProgressBar, setLabelSpeed, setLabelText, setSingleMax, setSingleProgress, setSingleProgressPercents, setTotalMax, setTotalProgress, updateProgressBar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

private static final Downloader INSTANCE
Constructor Detail

Downloader

private Downloader()
Creates a new instance of Downloader

Method Detail

getInstance

public static Downloader getInstance()

executeNext

void executeNext()
Main download procedure - Set total size of install object to same like download size. (I suppose, user want install all downloaded files) - Update progress during downloading. - Check if file exists at local storage (if exists, try continue downloading). - Download file. - Check if file downloaded correct. - Aftre a file correctly downloaded, move it to Installer queue.

Specified by:
executeNext in class PatcherQueue

finishDownload

private void finishDownload(PatchItem p)
Finish download procedure - update download status - add item to install queue and run Installer - remove downlaoded file from download queue


addPatchItem

protected void addPatchItem(PatchItem p)
Add new PatchItem to queue. Overriding patchQueue method add progressbar max size counting funcion.

Overrides:
addPatchItem in class PatcherQueue
Parameters:
p - item to add
See Also:
executeNext()