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

All Known Implementing Classes:
ResourceDownloaderFactoryImpl

public interface ResourceDownloaderFactory


Method Summary
 ResourceDownloader create(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
 ResourceDownloader create(ResourceDownloaderDelayedFactory factory)
          creates a downloader that will be asked to create a ResourceDownloader when required.
 ResourceDownloader create(java.net.URL url)
          creates a basic downloader.
 ResourceDownloader create(java.net.URL url, boolean force_no_proxy)
          Creates a basic downloader, where you can force any configured proxy to be avoided.
 ResourceDownloader create(java.net.URL url, byte[] post_data)
           
 ResourceDownloader create(java.net.URL url, java.net.Proxy force_proxy)
           
 ResourceDownloader create(java.net.URL url, java.lang.String post_data)
           
 ResourceDownloader create(java.net.URL url, java.lang.String post_data, java.net.Proxy proxy)
           
 ResourceDownloader create(java.net.URL url, java.lang.String user_name, java.lang.String password)
           
 ResourceDownloader createWithAutoPluginProxy(java.net.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(java.lang.String project_name, java.lang.String file_name)
          Creates a resource downloader which can be used to download a file from a Sourceforge project (from different mirrors).
 ResourceDownloader[] getSourceforgeDownloaders(java.lang.String project_name, java.lang.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, java.io.File download_directory)
          Download a torrent's data to the given download location
 

Method Detail

create

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

Parameters:
file -
Returns:

create

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

Parameters:
url -
Returns:

createWithAutoPluginProxy

ResourceDownloader createWithAutoPluginProxy(java.net.URL url)

create

ResourceDownloader create(java.net.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(java.net.URL url,
                          java.net.Proxy force_proxy)
Since:
5.2.0.1

create

ResourceDownloader create(java.net.URL url,
                          java.lang.String user_name,
                          java.lang.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,
                                        java.io.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(java.net.URL url,
                          java.lang.String post_data)
Parameters:
url -
postData -
Returns:

create

ResourceDownloader create(java.net.URL url,
                          java.lang.String post_data,
                          java.net.Proxy proxy)

create

ResourceDownloader create(java.net.URL url,
                          byte[] post_data)

getSourceforgeDownloaders

ResourceDownloader[] getSourceforgeDownloaders(java.lang.String project_name,
                                               java.lang.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(java.lang.String project_name,
                                            java.lang.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