FileDocCategorySizeDatePackage
ResourceDownloaderFactory.javaAPI DocAzureus 3.0.3.44773Mon Oct 23 17:42:24 BST 2006org.gudy.azureus2.plugins.utils.resourcedownloader

ResourceDownloaderFactory

public interface ResourceDownloaderFactory
author
parg

Fields Summary
Constructors Summary
Methods Summary
public ResourceDownloadercreate(java.io.File file)
Creates a downloader for a local file - in particular this is useful for installing a plugin from a local file as the installer required ResourceDownloader instances to operate

param
file
return

public ResourceDownloadercreate(java.net.URL url, java.lang.String postData)

param
url
param
postData
return

public ResourceDownloadercreate(java.net.URL url)
creates a basic downloader. current url must be http or https

param
url
return

public ResourceDownloadercreate(java.net.URL url, java.lang.String user_name, java.lang.String password)

public ResourceDownloadercreate(ResourceDownloaderDelayedFactory factory)
creates a downloader that will be asked to create a ResourceDownloader when required. Useful when used in combination with an alternate downloader so that time isn't wasted creating downloaders for subsequent possibilities if the first one succeeds

param
factory
return

public ResourceDownloadergetAlternateDownloader(ResourceDownloader[] downloaders)
gets a downloader that will cycle through a list of downloaders until a download succeeds

param
downloaders
return

public ResourceDownloadergetAlternateDownloader(ResourceDownloader[] downloaders, int max_to_try)

public ResourceDownloadergetMetaRefreshDownloader(ResourceDownloader downloader)
gets a downloader that will automatically follow META refresh tags Will only do a single level of indirection

param
downloader
return

public ResourceDownloadergetRandomDownloader(ResourceDownloader[] downloaders, int max_to_try)

public ResourceDownloadergetRandomDownloader(ResourceDownloader[] downloaders)
an alternative downloader that randomises the downloaders

param
downloaders
return

public ResourceDownloadergetRetryDownloader(ResourceDownloader downloader, int retry_count)
gets a downloader that will retry a number of times before failing

param
downloader
param
retry_count
return

public ResourceDownloadergetSuffixBasedDownloader(ResourceDownloader downloader)
Returns a downloader that does something sensible based on the url suffix. In particular will return a torrent downloader if the URL ends with ".torrent" The decision is made based on a random child downloader, so don't mix URL suffixes below this point in the hierarchy

param
url
return

public ResourceDownloadergetTimeoutDownloader(ResourceDownloader downloader, int timeout_millis)
gets a downloader that will timeout after a given period

param
downloader
param
timeout_millis
return

public ResourceDownloadergetTorrentDownloader(ResourceDownloader downloader, boolean persistent)
Given a downloader that will download a torrent, this will download the torrent data itself. Note that the torrent MUST contain only a single file (although a future enhancement may return a ZIP input stream for multi-file torrents)

param
downloader
param
persistent whether or not the d/l will be retained over az stop/start
return

public ResourceDownloadergetTorrentDownloader(ResourceDownloader downloader, boolean persistent, java.io.File download_directory)
Download a torrent's data to the given download location

param
downloader
param
persistent
param
download_directory
return