|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.net.Download
public class Download
Downloads a file into memory. Handles partial HTTP downloads if the first attempt downloads only a portion of the file.
Field Summary | |
---|---|
static int |
CANCELED
|
static int |
DOWNLOADING
|
static int |
ERROR
|
static int |
IDLE
|
static int |
SUCCESS
|
Constructor Summary | |
---|---|
Download(URL url)
|
Method Summary | |
---|---|
void |
cancel()
|
int |
getBytesRead()
Returns the number of bytes downloaded. |
byte[] |
getData()
|
long |
getEstimatedTimeRemaining()
|
Throwable |
getLastException()
|
double |
getPercentDownloaded()
Returns a values less than zero if the percent not known |
int |
getSize()
Returns the size of the file currently downloading, or -1 if not known. |
int |
getState()
|
void |
run()
|
void |
start()
|
static Download |
startDownload(String file)
Starts downloading a file from the server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IDLE
public static final int DOWNLOADING
public static final int SUCCESS
public static final int CANCELED
public static final int ERROR
Constructor Detail |
---|
public Download(URL url)
Method Detail |
---|
public static Download startDownload(String file)
public void start()
public void cancel()
public int getSize()
public int getBytesRead()
public double getPercentDownloaded()
public Throwable getLastException()
public byte[] getData()
public int getState()
public long getEstimatedTimeRemaining()
public void run()
run
in interface Runnable
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |