|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.freeshell.zs.common.Downloader
public class Downloader
Download a remote resource.
| Constructor Summary | |
|---|---|
Downloader(java.net.URL url,
java.lang.Object target)
Constructor. |
|
| Method Summary | |
|---|---|
void |
cancel()
Cancel the download. |
int |
getDownloadedLength()
Get the number of bytes downloaded. |
int |
getLength()
Get the length of the remote resource. |
int |
getProgressPercent()
Get the percentage describing the current progress. |
java.lang.String |
getProgressString()
Get a string describing the current progress. |
boolean |
isCancelled()
Is the download cancelled? |
boolean |
isCompleted()
Is the download completed? |
boolean |
isProgressUpdated()
Has there been an update in the progress? The progressUpdated flag is set to false before this method returns. |
boolean |
isRunning()
Is the downloader running? |
boolean |
isStarted()
Has the download started? |
void |
pause()
Pause the download. |
void |
resume()
Resume the download. |
void |
run()
Start downloading the remote resource. |
void |
waitUntilCompleted()
Wait until the download is completed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Downloader(java.net.URL url,
java.lang.Object target)
url - URL of the remote resource to be downloadedtarget - target object to be populated (File or StringBuilder object)| Method Detail |
|---|
public int getLength()
public int getDownloadedLength()
public java.lang.String getProgressString()
public int getProgressPercent()
public boolean isProgressUpdated()
public void pause()
public void resume()
public void cancel()
public boolean isStarted()
public boolean isRunning()
public boolean isCancelled()
public boolean isCompleted()
public void waitUntilCompleted()
throws java.lang.Exception
java.lang.Exception - if an error has occurred during download, or if the download was cancelledpublic void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||