|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The downloader interface. The UI maintains a list of Downloader's and uses its methods to stop and resume downloads. Note that there is no start method; it is assumed that the downloader will start as soon as it is instantiated.
Field Summary | |
static int |
ABORTED
|
static int |
COMPLETE
|
static int |
CONNECTING
|
static int |
CORRUPT_FILE
|
static int |
COULDNT_MOVE_TO_LIBRARY
|
static int |
DOWNLOADING
|
static int |
GAVE_UP
When a downloader is in the GAVE_UP state, it can still try downloading if matching results pour in. |
static int |
HASHING
|
static int |
QUEUED
|
static int |
REMOTE_QUEUED
|
static int |
SAVING
|
static int |
WAITING_FOR_CONNECTIONS
|
static int |
WAITING_FOR_RESULTS
|
static int |
WAITING_FOR_RETRY
|
static int |
WAITING_FOR_USER
|
Method Summary | |
void |
discardCorruptDownload(boolean delete)
either treats a corrupt file as normal file and saves it, or discards the corruptFile, depending on the value of delete. |
java.lang.String |
getAddress()
Returns the last address that this tried to connect to, or null if it hasn't tried any. |
int |
getAmountRead()
Returns the amount read by this so far, in bytes. |
RemoteFileDesc |
getBrowseEnabledHost()
Returns a browse-enabled Endpoint instance for this Downloader. |
int |
getBusyHostCount()
|
Endpoint |
getChatEnabledHost()
Returns a chat-enabled Endpoint instance for this Downloader. |
int |
getContentLength()
Returns the size of this file in bytes, i.e., the total amount to download. |
java.io.File |
getDownloadFragment()
If this download is not yet complete, returns a copy of the first contiguous fragment of the incomplete file. |
java.lang.String |
getFileName()
Returns the name of the current or last file this is downloading, or null in the rare case that this has no more files to download. |
java.util.Iterator |
getHosts()
Returns the locations from which this is currently downloading, as an iterator of Endpoint. |
int |
getNumberOfAlternateLocations()
Return the number of validated alternate locations for this download |
int |
getPossibleHostCount()
|
int |
getQueuedHostCount()
|
java.lang.String |
getQueuePosition()
Returns the position of the download on the uploader, relavent only if the downloader is queueud. |
int |
getRemainingStateTime()
Returns an upper bound on the amount of time this will stay in the current state, in seconds. |
int |
getRetriesWaiting()
Returns the number of retries this is waiting for. |
int |
getState()
Returns the state of this: one of QUEUED, CONNECTING, DOWNLOADING, WAITING_FOR_RETRY, COMPLETE, ABORTED, GAVE_UP, COULDNT_MOVE_TO_LIBRARY, WAITING_FOR_RESULTS, or CORRUPT_FILE |
java.lang.String |
getVendor()
Returns the vendor of the last downloading host. |
boolean |
hasBrowseEnabledHost()
Returns whether or not there is a browse-enabled host available for this Downloader. |
boolean |
hasChatEnabledHost()
Returns whether or not there is a chat-enabled host available for this Downloader. |
boolean |
resume()
Resumes this. |
void |
stop()
Stops this. |
Methods inherited from interface com.limegroup.gnutella.BandwidthTracker |
getAverageBandwidth, getMeasuredBandwidth, measureBandwidth |
Field Detail |
public static final int QUEUED
public static final int CONNECTING
public static final int DOWNLOADING
public static final int WAITING_FOR_RETRY
public static final int COMPLETE
public static final int ABORTED
public static final int GAVE_UP
public static final int COULDNT_MOVE_TO_LIBRARY
public static final int WAITING_FOR_RESULTS
public static final int CORRUPT_FILE
public static final int REMOTE_QUEUED
public static final int HASHING
public static final int SAVING
public static final int WAITING_FOR_USER
public static final int WAITING_FOR_CONNECTIONS
Method Detail |
public void stop()
public boolean resume() throws AlreadyDownloadingException
AlreadyDownloadingException
public java.io.File getDownloadFragment()
public int getState()
public int getRemainingStateTime()
public java.lang.String getFileName()
public int getContentLength()
public int getAmountRead()
public int getRetriesWaiting()
public java.lang.String getAddress()
public java.util.Iterator getHosts()
public java.lang.String getVendor()
public Endpoint getChatEnabledHost()
public boolean hasChatEnabledHost()
public void discardCorruptDownload(boolean delete)
public RemoteFileDesc getBrowseEnabledHost()
public boolean hasBrowseEnabledHost()
public java.lang.String getQueuePosition()
public int getNumberOfAlternateLocations()
public int getPossibleHostCount()
public int getBusyHostCount()
public int getQueuedHostCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |