org.gudy.azureus2.plugins.utils.resourcedownloader
Interface ResourceDownloader

All Known Implementing Classes:
ResourceDownloaderAlternateImpl, ResourceDownloaderBaseImpl, ResourceDownloaderDelayedImpl, ResourceDownloaderErrorImpl, ResourceDownloaderFileImpl, ResourceDownloaderMetaRefreshImpl, ResourceDownloaderRetryImpl, ResourceDownloaderTimeoutImpl, ResourceDownloaderTorrentImpl, ResourceDownloaderURLImpl

public interface ResourceDownloader


Field Summary
static java.lang.String PR_BOOLEAN_ANONYMOUS
           
static java.lang.String PR_STRING_CONTENT_TYPE
           
 
Method Summary
 void addListener(ResourceDownloaderListener l)
           
 void asyncDownload()
          Asynchronously download.
 void cancel()
          Cancel the download.
 java.io.InputStream download()
          Synchronously download.
 ResourceDownloader getClone()
           
 java.lang.String getName()
          Get a sensible name for the download based on its details (e.g.
 java.lang.Object getProperty(java.lang.String name)
          Warning! URL response properties have a type of 'List of String'
 long getSize()
          Attempts to get the size of the download.
 boolean isCancelled()
           
 void removeListener(ResourceDownloaderListener l)
           
 void reportActivity(java.lang.String activity)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 

Field Detail

PR_STRING_CONTENT_TYPE

static final java.lang.String PR_STRING_CONTENT_TYPE
See Also:
Constant Field Values

PR_BOOLEAN_ANONYMOUS

static final java.lang.String PR_BOOLEAN_ANONYMOUS
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Get a sensible name for the download based on its details (e.g. URL)

Returns:

download

java.io.InputStream download()
                             throws ResourceDownloaderException
Synchronously download. Events are still reported to listeners

Returns:
Throws:
ResourceDownloaderException

asyncDownload

void asyncDownload()
Asynchronously download.


getSize

long getSize()
             throws ResourceDownloaderException
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

setProperty

void setProperty(java.lang.String name,
                 java.lang.Object value)
                 throws ResourceDownloaderException
Throws:
ResourceDownloaderException

getProperty

java.lang.Object getProperty(java.lang.String name)
                             throws ResourceDownloaderException
Warning! URL response properties have a type of 'List of String'

Parameters:
name -
Returns:
Throws:
ResourceDownloaderException

cancel

void cancel()
Cancel the download.


isCancelled

boolean isCancelled()

getClone

ResourceDownloader getClone()

reportActivity

void reportActivity(java.lang.String activity)

addListener

void addListener(ResourceDownloaderListener l)

removeListener

void removeListener(ResourceDownloaderListener l)