Interface ResourceDownloaderFactory

All Known Implementing Classes:
ResourceDownloaderFactoryImpl

public interface ResourceDownloaderFactory
  • Method Details

    • 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

      default ResourceDownloader createWithAutoPluginProxy(URL url)
    • createWithAutoPluginProxy

      ResourceDownloader createWithAutoPluginProxy(URL url, Map<String,Object> options)
    • 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

      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)