ecologylab.io
Class DownloadableFileToDisk

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.io.DownloadableFileToDisk
All Implemented Interfaces:
DispatchTarget, Downloadable

public class DownloadableFileToDisk
extends Debug
implements Downloadable, DispatchTarget


Constructor Summary
DownloadableFileToDisk(ParsedURL target, java.io.File destination)
           
DownloadableFileToDisk(ParsedURL target, java.io.File destination, StatusReporter status)
           
 
Method Summary
 void delivery(java.lang.Object o)
          Called, probably later asynchronously, when the requested service is complete.
 void downloadDone()
          Call to notify the object that its download is completed;
 void handleIoError()
          Called in case an IO error happens.
 boolean handleTimeout()
          Called in case a timeout happens.
 boolean isDownloadDone()
          Called to inquire on the status of a download.
 boolean isRecycled()
          True if the Downloadable has been recycled, and thus should not be downloaded.
 void performDownload()
          Called to start download.
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DownloadableFileToDisk

public DownloadableFileToDisk(ParsedURL target,
                              java.io.File destination,
                              StatusReporter status)

DownloadableFileToDisk

public DownloadableFileToDisk(ParsedURL target,
                              java.io.File destination)
Method Detail

downloadDone

public void downloadDone()
Description copied from interface: Downloadable
Call to notify the object that its download is completed;

Specified by:
downloadDone in interface Downloadable

handleIoError

public void handleIoError()
Description copied from interface: Downloadable
Called in case an IO error happens.

Specified by:
handleIoError in interface Downloadable

handleTimeout

public boolean handleTimeout()
Description copied from interface: Downloadable
Called in case a timeout happens.

Specified by:
handleTimeout in interface Downloadable
Returns:
true, if the object is able to abort the download and release resources.

isDownloadDone

public boolean isDownloadDone()
Description copied from interface: Downloadable
Called to inquire on the status of a download.

Specified by:
isDownloadDone in interface Downloadable
Returns:
true if the download is complete.

performDownload

public void performDownload()
                     throws java.lang.Exception
Description copied from interface: Downloadable
Called to start download.

Specified by:
performDownload in interface Downloadable
Throws:
java.lang.Exception

delivery

public void delivery(java.lang.Object o)
Description copied from interface: DispatchTarget
Called, probably later asynchronously, when the requested service is complete.

Specified by:
delivery in interface DispatchTarget
Parameters:
o - -- enables an argument of any type to be passed back.

isRecycled

public boolean isRecycled()
Description copied from interface: Downloadable
True if the Downloadable has been recycled, and thus should not be downloaded.

Specified by:
isRecycled in interface Downloadable
Returns: