|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.erowid.sperowider.DownloadRunner
Does the downloading, using repeated calls to a Downloader class.
Field Summary | |
static int |
WHEN_LIMIT_IS_REACHED
The termination type indicating that files should be downloaded and spidered until the limit (as set via setLimit(int) ) is reached, or until no more URLs
are found. |
static int |
WHEN_NO_MORE_URLS
The termination type indicating that files should be downloaded and spidered until no more valid files are found. |
Constructor Summary | |
DownloadRunner(SperowiderContext context,
int terminationType)
Instantiates a downloader, with a given download model. |
Method Summary | |
int |
getDownloadStatisticCount(int downloadStatus)
Returns the number of downloads that have resulted in the passed in status. |
int |
getHttpResponseCodeCount(int httpResponseCode)
Returns the number of Http responses of each kind. |
int |
getTotalDownloadAttempts()
Returns the total number of download attempts. |
int |
getTotalHttpAttempts()
Returns the total number of download attempts. |
int |
run()
Starts downloading and spidering, with the passed in URL as the first URL. |
void |
setLimit(int limit)
Sets the total number of files to download. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int WHEN_NO_MORE_URLS
public static final int WHEN_LIMIT_IS_REACHED
setLimit(int)
) is reached, or until no more URLs
are found.
Constructor Detail |
public DownloadRunner(SperowiderContext context, int terminationType)
Method Detail |
public void setLimit(int limit)
public int getDownloadStatisticCount(int downloadStatus)
ASpiderBase.SUCCESS
, ASpiderBase.ALREADY_GRABBED
,
ASpiderBase.BAD_HTTP_RESPONSE
, ASpiderBase.EXCEPTION
, ASpiderBase.FILTER_FAILURE
,
ASpiderBase.SUCCESS
.
public int getHttpResponseCodeCount(int httpResponseCode)
public int getTotalDownloadAttempts()
public int getTotalHttpAttempts()
getTotalDownloadAttempts()
, because this counts
each 302 as an Http attempt.
public int run()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |