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

All Known Implementing Classes:
ResourceDownloaderFactoryImpl

public interface ResourceDownloaderFactory


Method Summary
 ResourceDownloader create(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
 ResourceDownloader create(ResourceDownloaderDelayedFactory factory)
          creates a downloader that will be asked to create a ResourceDownloader when required.
 ResourceDownloader create(URL url)
          creates a basic downloader.
 ResourceDownloader create(URL url, boolean force_no_proxy)
          Creates a basic downloader, where you can force any configured proxy to be avoided.
 ResourceDownloader create(URL url, byte[] post_data)
           
 ResourceDownloader create(URL url, Proxy force_proxy)
           
 ResourceDownloader create(URL url, String post_data)
           
 ResourceDownloader create(URL url, String post_data, Proxy proxy)
           
 ResourceDownloader create(URL url, String user_name, String password)
           
 ResourceDownloader createWithAutoPluginProxy(URL url)
           
 ResourceDownloader getAlternateDownloader(ResourceDownloader[] downloaders)
          Gets a downloader that will cycle through a list of downloaders until a download succeeds.
 ResourceDownloader getAlternateDownloader(ResourceDownloader[] downloaders, int max_to_try)
          Gets a downloader that will cycle through a list of downloaders until a download succeeds.
 ResourceDownloader getMetaRefreshDownloader(ResourceDownloader downloader)
          gets a downloader that will automatically follow META refresh tags Will only do a single level of indirection
 ResourceDownloader getRandomDownloader(ResourceDownloader[] downloaders)
          Gets a downloader that will cycle through a list of downloaders until a download succeeds.
 ResourceDownloader getRandomDownloader(ResourceDownloader[] downloaders, int max_to_try)
          Gets a downloader that will cycle through a list of downloaders until a download succeeds.
 ResourceDownloader getRetryDownloader(ResourceDownloader downloader, int retry_count)
          gets a downloader that will retry a number of times before failing
 ResourceDownloader getSourceforgeDownloader(String project_name, String file_name)
          Creates a resource downloader which can be used to download a file from a Sourceforge project (from different mirrors).
 ResourceDownloader[] getSourceforgeDownloaders(String project_name, String file_name)
          Creates multiple resource downloaders which can be used to download a file from a Sourceforge project (from different mirrors).
 ResourceDownloader getSuffixBasedDownloader(ResourceDownloader downloader)
          Returns a downloader that does something sensible based on the url suffix.
 ResourceDownloader getTimeoutDownloader(ResourceDownloader downloader, int timeout_millis)
          gets a downloader that will timeout after a given period
 ResourceDownloader getTorrentDownloader(ResourceDownloader downloader, boolean persistent)
          Given a downloader that will download a torrent, this will download the torrent data itself.
 ResourceDownloader getTorrentDownloader(ResourceDownloader downloader, boolean persistent, File download_directory)
          Download a torrent's data to the given download location
 

Method Detail

create

ResourceDownloader create(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

Parameters:
file -
Returns:

create

ResourceDownloader create(URL url)
creates a basic downloader. current url must be http or https

Parameters:
url -
Returns:

createWithAutoPluginProxy

ResourceDownloader createWithAutoPluginProxy(URL url)

create

ResourceDownloader create(URL url,
                          boolean force_no_proxy)
Creates a basic downloader, where you can force any configured proxy to be avoided.

Since:
3.1.0.1

create

ResourceDownloader create(URL url,
                          Proxy force_proxy)
Since:
5.2.0.1

create

ResourceDownloader create(URL url,
                          String user_name,
                          String password)

create

ResourceDownloader create(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

Parameters:
factory -
Returns:

getRetryDownloader

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

Parameters:
downloader -
retry_count -
Returns:

getTimeoutDownloader

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

Parameters:
downloader -
timeout_millis -
Returns:

getAlternateDownloader

ResourceDownloader getAlternateDownloader(ResourceDownloader[] downloaders)
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried in order.


getAlternateDownloader

ResourceDownloader getAlternateDownloader(ResourceDownloader[] downloaders,
                                          int max_to_try)
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried in order.


getRandomDownloader

ResourceDownloader getRandomDownloader(ResourceDownloader[] downloaders)
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried randomly.


getRandomDownloader

ResourceDownloader getRandomDownloader(ResourceDownloader[] downloaders,
                                       int max_to_try)
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried randomly.


getMetaRefreshDownloader

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

Parameters:
downloader -
Returns:

getTorrentDownloader

ResourceDownloader getTorrentDownloader(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)

Parameters:
downloader -
persistent - whether or not the d/l will be retained over az stop/start
Returns:

getTorrentDownloader

ResourceDownloader getTorrentDownloader(ResourceDownloader downloader,
                                        boolean persistent,
                                        File download_directory)
Download a torrent's data to the given download location

Parameters:
downloader -
persistent -
download_directory -
Returns:

getSuffixBasedDownloader

ResourceDownloader getSuffixBasedDownloader(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

Parameters:
url -
Returns:

create

ResourceDownloader create(URL url,
                          String post_data)
Parameters:
url -
postData -
Returns:

create

ResourceDownloader create(URL url,
                          String post_data,
                          Proxy proxy)

create

ResourceDownloader create(URL url,
                          byte[] post_data)

getSourceforgeDownloaders

ResourceDownloader[] getSourceforgeDownloaders(String project_name,
                                               String file_name)
Creates multiple resource downloaders which can be used to download a file from a Sourceforge project (from different mirrors). The resulting downloaders can then be passed to a method such as getRandomDownloader(ResourceDownloader[]).

Since:
3.0.5.3

getSourceforgeDownloader

ResourceDownloader getSourceforgeDownloader(String project_name,
                                            String file_name)
Creates a resource downloader which can be used to download a file from a Sourceforge project (from different mirrors).

Since:
3.0.5.3