org.erowid.sperowider
Class Downloader

java.lang.Object
  extended byorg.erowid.sperowider.ASpiderBase
      extended byorg.erowid.sperowider.Downloader

public class Downloader
extends ASpiderBase

Downloads files to the local drive.

Version:
$Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperowider/Downloader.java,v 1.28 2005/03/12 21:07:17 gurustu Exp $
Author:
Stu Statman

Field Summary
 
Fields inherited from class org.erowid.sperowider.ASpiderBase
ALREADY_GRABBED, BAD_HTTP_RESPONSE, EXCEPTION, FILTER_FAILURE, SPEROWIDER_USER_AGENT, SPEROWIDER_USER_AGENT_NAME, SPEROWIDER_USER_AGENT_VERSION, SUCCESS
 
Constructor Summary
Downloader(SperowiderContext context)
          Instantiates a downloader, with a given download model.
 
Method Summary
 int handleConnection(String sourceUrl, HttpURLConnection bConnection)
          Delegates to the appropriate AHandler.
 void handleConnectionException(String sourceUrl, Throwable e)
          IO exceptions get marked as invalid URLs.
 
Methods inherited from class org.erowid.sperowider.ASpiderBase
getDownloadStatisticCount, getHttpResponseCodeCount, getTotalDownloadAttempts, getTotalHttpAttempts, spider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Downloader

public Downloader(SperowiderContext context)
Instantiates a downloader, with a given download model. The download root is where it should download to.

Method Detail

handleConnection

public int handleConnection(String sourceUrl,
                            HttpURLConnection bConnection)
Delegates to the appropriate AHandler.

Specified by:
handleConnection in class ASpiderBase

handleConnectionException

public void handleConnectionException(String sourceUrl,
                                      Throwable e)
IO exceptions get marked as invalid URLs. Other exceptions just get logged.

Specified by:
handleConnectionException in class ASpiderBase

spero logo small Sperowider is
© 2005 Erowid.org