Interface ResourceDownloaderFactory
- All Known Implementing Classes:
ResourceDownloaderFactoryImpl
public interface ResourceDownloaderFactory
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(ResourceDownloaderDelayedFactory factory) creates a downloader that will be asked to create a ResourceDownloader when required.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 operatecreates a basic downloader.Creates a basic downloader, where you can force any configured proxy to be avoided.default ResourceDownloader
createWithAutoPluginProxy
(URL url, Map<String, Object> options) getAlternateDownloader
(ResourceDownloader[] downloaders) Gets a downloader that will cycle through a list of downloaders until a download succeeds.getAlternateDownloader
(ResourceDownloader[] downloaders, int max_to_try) Gets a downloader that will cycle through a list of downloaders until a download succeeds.getMetaRefreshDownloader
(ResourceDownloader downloader) gets a downloader that will automatically follow META refresh tags Will only do a single level of indirectiongetRandomDownloader
(ResourceDownloader[] downloaders) Gets a downloader that will cycle through a list of downloaders until a download succeeds.getRandomDownloader
(ResourceDownloader[] downloaders, int max_to_try) Gets a downloader that will cycle through a list of downloaders until a download succeeds.getRetryDownloader
(ResourceDownloader downloader, int retry_count) gets a downloader that will retry a number of times before failinggetSuffixBasedDownloader
(ResourceDownloader downloader) Returns a downloader that does something sensible based on the url suffix.getTimeoutDownloader
(ResourceDownloader downloader, int timeout_millis) gets a downloader that will timeout after a given periodgetTorrentDownloader
(ResourceDownloader downloader, boolean persistent) Given a downloader that will download a torrent, this will download the torrent data itself.getTorrentDownloader
(ResourceDownloader downloader, boolean persistent, File download_directory) Download a torrent's data to the given download location
-
Method Details
-
create
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
creates a basic downloader. current url must be http or https- Parameters:
url
-- Returns:
-
createWithAutoPluginProxy
-
createWithAutoPluginProxy
-
create
Creates a basic downloader, where you can force any configured proxy to be avoided.- Since:
- 3.1.0.1
-
create
- Since:
- 5.2.0.1
-
create
-
create
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
gets a downloader that will retry a number of times before failing- Parameters:
downloader
-retry_count
-- Returns:
-
getTimeoutDownloader
gets a downloader that will timeout after a given period- Parameters:
downloader
-timeout_millis
-- Returns:
-
getAlternateDownloader
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried in order. -
getAlternateDownloader
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried in order. -
getRandomDownloader
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried randomly. -
getRandomDownloader
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried randomly. -
getMetaRefreshDownloader
gets a downloader that will automatically follow META refresh tags Will only do a single level of indirection- Parameters:
downloader
-- Returns:
-
getTorrentDownloader
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
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
- Parameters:
url
-postData
-- Returns:
-
create
-
create
-