org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader
Class ResourceDownloaderErrorImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
      extended by org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderErrorImpl
All Implemented Interfaces:
ResourceDownloader

public class ResourceDownloaderErrorImpl
extends ResourceDownloaderBaseImpl


Field Summary
protected  ResourceDownloaderException error
           
 
Fields inherited from class org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
this_mon
 
Fields inherited from interface org.gudy.azureus2.plugins.utils.resourcedownloader.ResourceDownloader
PR_STRING_CONTENT_TYPE
 
Constructor Summary
protected ResourceDownloaderErrorImpl(ResourceDownloaderBaseImpl _parent, ResourceDownloaderException _error)
           
 
Method Summary
 void addListener(ResourceDownloaderListener l)
           
 void asyncDownload()
          Asynchronously download.
 void cancel()
          Cancel the download.
 InputStream download()
          Synchronously download.
 ResourceDownloaderBaseImpl getClone(ResourceDownloaderBaseImpl parent)
           
 String getName()
          Get a sensible name for the download based on its details (e.g.
 long getSize()
          Attempts to get the size of the download.
 void reportActivity(String activity)
           
 void setProperty(String name, Object value)
           
protected  void setSize(long size)
           
 
Methods inherited from class org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
addChild, addReportListener, getBooleanProperty, getChildren, getClone, getLCKeyProperties, getLogIndent, getLongProperty, getParent, getProperty, getPropertySupport, getStringProperty, getStringPropertySupport, informActivity, informAmountComplete, informComplete, informFailed, informPercentDone, isCancelled, removeChild, removeListener, reportActivity, reportAmountComplete, reportPercentComplete, setCancelled, setParent, setProperties, setPropertiesSet, setPropertySupport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

error

protected ResourceDownloaderException error
Constructor Detail

ResourceDownloaderErrorImpl

protected ResourceDownloaderErrorImpl(ResourceDownloaderBaseImpl _parent,
                                      ResourceDownloaderException _error)
Method Detail

getName

public String getName()
Description copied from interface: ResourceDownloader
Get a sensible name for the download based on its details (e.g. URL)

Returns:

getClone

public ResourceDownloaderBaseImpl getClone(ResourceDownloaderBaseImpl parent)
Specified by:
getClone in class ResourceDownloaderBaseImpl

download

public InputStream download()
                     throws ResourceDownloaderException
Description copied from interface: ResourceDownloader
Synchronously download. Events are still reported to listeners

Returns:
Throws:
ResourceDownloaderException

asyncDownload

public void asyncDownload()
Description copied from interface: ResourceDownloader
Asynchronously download.


setSize

protected void setSize(long size)
Specified by:
setSize in class ResourceDownloaderBaseImpl

setProperty

public void setProperty(String name,
                        Object value)

getSize

public long getSize()
             throws ResourceDownloaderException
Description copied from interface: ResourceDownloader
Attempts to get the size of the download. Returns -1 if the size can't be determined.

Note: You must not call this method from the reportActivity callback method.

Throws:
ResourceDownloaderException

cancel

public void cancel()
Description copied from interface: ResourceDownloader
Cancel the download.


reportActivity

public void reportActivity(String activity)
Specified by:
reportActivity in interface ResourceDownloader
Overrides:
reportActivity in class ResourceDownloaderBaseImpl

addListener

public void addListener(ResourceDownloaderListener l)
Specified by:
addListener in interface ResourceDownloader
Overrides:
addListener in class ResourceDownloaderBaseImpl