Class FileDownloadWindow

java.lang.Object
com.biglybt.ui.swt.FileDownloadWindow
All Implemented Interfaces:
TorrentDownloaderCallBackInterface, IProgressReportConstants

public class FileDownloadWindow extends Object implements TorrentDownloaderCallBackInterface, IProgressReportConstants
  • Field Details

  • Constructor Details

    • FileDownloadWindow

      public FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, Runnable runOnError)
      Create a file download window. Add torrent when done downloading
      Parameters:
      parent -
      url -
      referrer -
    • FileDownloadWindow

      public FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener)
      Create a file download window. If no listener is supplied, torrent will be added when download is complete. If a listener is supplied, caller handles it
      Parameters:
      parent -
      url -
      referrer -
      listener -
    • FileDownloadWindow

      private FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener, Runnable callOnError)
    • FileDownloadWindow

      public FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, boolean force_dialog)
  • Method Details

    • handleByProtocol

      private boolean handleByProtocol()
    • init

      private void init()
    • setupAndShowDialog

      private void setupAndShowDialog()
      Initializes the reporter and show the download dialog if it is not suppressed
    • TorrentDownloaderEvent

      public void TorrentDownloaderEvent(int state, TorrentDownloader inf)
      Specified by:
      TorrentDownloaderEvent in interface TorrentDownloaderCallBackInterface
    • update

      private void update()
    • getShortURL

      private String getShortURL(String url)
      Returns a shortened version of the given url
      Parameters:
      url -
      Returns:
    • getFileName

      private String getFileName(String url)
      Brute-force extraction of the torrent file name or title from the given URL
      Parameters:
      url -
      Returns: