Class ResourceDownloaderFactoryImpl
java.lang.Object
com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderFactoryImpl
- All Implemented Interfaces:
ResourceDownloaderFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final LogIDs
protected static ResourceDownloaderFactoryImpl
-
Constructor Summary
Constructors -
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.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.protected ResourceDownloader
getAlternateDownloader
(ResourceDownloader[] downloaders, int max_to_try, boolean random) 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 failingstatic ResourceDownloaderFactory
getSuffixBasedDownloader
(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 locationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.pif.utils.resourcedownloader.ResourceDownloaderFactory
createWithAutoPluginProxy
-
Field Details
-
LOGID
-
singleton
-
-
Constructor Details
-
ResourceDownloaderFactoryImpl
public ResourceDownloaderFactoryImpl()
-
-
Method Details
-
getSingleton
-
create
Description copied from interface:ResourceDownloaderFactory
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- Specified by:
create
in interfaceResourceDownloaderFactory
- Returns:
-
create
Description copied from interface:ResourceDownloaderFactory
creates a basic downloader. current url must be http or https- Specified by:
create
in interfaceResourceDownloaderFactory
- Returns:
-
createWithAutoPluginProxy
- Specified by:
createWithAutoPluginProxy
in interfaceResourceDownloaderFactory
-
create
Description copied from interface:ResourceDownloaderFactory
Creates a basic downloader, where you can force any configured proxy to be avoided.- Specified by:
create
in interfaceResourceDownloaderFactory
-
create
- Specified by:
create
in interfaceResourceDownloaderFactory
-
create
- Specified by:
create
in interfaceResourceDownloaderFactory
- Returns:
-
create
- Specified by:
create
in interfaceResourceDownloaderFactory
-
create
- Specified by:
create
in interfaceResourceDownloaderFactory
-
create
- Specified by:
create
in interfaceResourceDownloaderFactory
-
create
Description copied from interface:ResourceDownloaderFactory
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- Specified by:
create
in interfaceResourceDownloaderFactory
- Returns:
-
getRetryDownloader
Description copied from interface:ResourceDownloaderFactory
gets a downloader that will retry a number of times before failing- Specified by:
getRetryDownloader
in interfaceResourceDownloaderFactory
- Returns:
-
getTimeoutDownloader
Description copied from interface:ResourceDownloaderFactory
gets a downloader that will timeout after a given period- Specified by:
getTimeoutDownloader
in interfaceResourceDownloaderFactory
- Returns:
-
getAlternateDownloader
Description copied from interface:ResourceDownloaderFactory
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried in order.- Specified by:
getAlternateDownloader
in interfaceResourceDownloaderFactory
-
getAlternateDownloader
Description copied from interface:ResourceDownloaderFactory
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried in order.- Specified by:
getAlternateDownloader
in interfaceResourceDownloaderFactory
-
getRandomDownloader
Description copied from interface:ResourceDownloaderFactory
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried randomly.- Specified by:
getRandomDownloader
in interfaceResourceDownloaderFactory
-
getRandomDownloader
Description copied from interface:ResourceDownloaderFactory
Gets a downloader that will cycle through a list of downloaders until a download succeeds. The resource downloaders will be tried randomly.- Specified by:
getRandomDownloader
in interfaceResourceDownloaderFactory
-
getAlternateDownloader
protected ResourceDownloader getAlternateDownloader(ResourceDownloader[] downloaders, int max_to_try, boolean random) -
getMetaRefreshDownloader
Description copied from interface:ResourceDownloaderFactory
gets a downloader that will automatically follow META refresh tags Will only do a single level of indirection- Specified by:
getMetaRefreshDownloader
in interfaceResourceDownloaderFactory
- Returns:
-
getTorrentDownloader
Description copied from interface:ResourceDownloaderFactory
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)- Specified by:
getTorrentDownloader
in interfaceResourceDownloaderFactory
persistent
- whether or not the d/l will be retained over az stop/start- Returns:
-
getTorrentDownloader
public ResourceDownloader getTorrentDownloader(ResourceDownloader downloader, boolean persistent, File download_directory) Description copied from interface:ResourceDownloaderFactory
Download a torrent's data to the given download location- Specified by:
getTorrentDownloader
in interfaceResourceDownloaderFactory
- Returns:
-
getSuffixBasedDownloader
Description copied from interface:ResourceDownloaderFactory
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- Specified by:
getSuffixBasedDownloader
in interfaceResourceDownloaderFactory
- Returns:
-