Class Downloader

java.lang.Object
me.hsgamer.hscore.downloader.core.Downloader

public class Downloader extends Object
The downloader
  • Constructor Details

    • Downloader

      public Downloader(DownloadInfoLoader downloadInfoLoader, InputStreamLoader inputStreamLoader, File folder)
      Create a new downloader
      Parameters:
      downloadInfoLoader - the loader
      folder - the folder to save downloaded files
  • Method Details

    • getFolder

      public File getFolder()
      Get the folder
      Returns:
      the folder
    • getDownloadInfoLoader

      public DownloadInfoLoader getDownloadInfoLoader()
      Get the download info loader
      Returns:
      the download info loader
    • getInputStreamLoader

      public InputStreamLoader getInputStreamLoader()
      Get the input stream loader
      Returns:
      the input stream loader
    • getDownloadInfo

      public Optional<DownloadInfo> getDownloadInfo(String name)
      Get the download info
      Parameters:
      name - the name
      Returns:
      the download info
    • getLoadedDownloadInfo

      public Map<String,DownloadInfo> getLoadedDownloadInfo()
      Get the loaded download infos
      Returns:
      the loaded download infos
    • isLoaded

      public boolean isLoaded()
      Check if the downloader finished loading the download infos
      Returns:
      true if it did
    • setup

      public void setup()
      Set up the downloader
    • onLoaded

      public void onLoaded()
      Call when the downloader is finished loading the download infos