Class FileDownloadWindow

    • Field Detail

      • force_dialog

        boolean force_dialog
      • callOnError

        private final java.lang.Runnable callOnError
      • parent

        org.eclipse.swt.widgets.Shell parent
      • original_url

        java.lang.String original_url
      • decoded_url

        java.lang.String decoded_url
      • referrer

        java.lang.String referrer
      • request_properties

        java.util.Map request_properties
      • dirName

        java.lang.String dirName
      • shortURL

        java.lang.String shortURL
      • lastState

        private int lastState
    • Constructor Detail

      • FileDownloadWindow

        public FileDownloadWindow​(org.eclipse.swt.widgets.Shell parent,
                                  java.lang.String url,
                                  java.lang.String referrer,
                                  java.util.Map request_properties,
                                  java.lang.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,
                                  java.lang.String url,
                                  java.lang.String referrer,
                                  java.util.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,
                                   java.lang.String url,
                                   java.lang.String referrer,
                                   java.util.Map request_properties,
                                   TorrentOpenOptions torrentOptions,
                                   TorrentDownloaderCallBackInterface listener,
                                   java.lang.Runnable callOnError)
      • FileDownloadWindow

        public FileDownloadWindow​(org.eclipse.swt.widgets.Shell parent,
                                  java.lang.String url,
                                  java.lang.String referrer,
                                  java.util.Map request_properties,
                                  boolean force_dialog)
    • Method Detail

      • 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
      • update

        private void update()
      • getShortURL

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

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