Package com.biglybt.ui.swt
Class FileDownloadWindow
java.lang.Object
com.biglybt.ui.swt.FileDownloadWindow
- All Implemented Interfaces:
TorrentDownloaderCallBackInterface
,IProgressReportConstants
public class FileDownloadWindow
extends Object
implements TorrentDownloaderCallBackInterface, IProgressReportConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Runnable
(package private) String
(package private) String
(package private) TorrentDownloader
(package private) boolean
private int
(package private) TorrentDownloaderCallBackInterface
(package private) String
(package private) org.eclipse.swt.widgets.Shell
(package private) IProgressReporter
(package private) String
(package private) Map
(package private) String
(package private) TorrentOpenOptions
Fields inherited from interface com.biglybt.ui.swt.progress.IProgressReportConstants
AUTO_CLOSE, BORDER, MANAGER_EVENT_ADDED, MANAGER_EVENT_REMOVED, MANAGER_EVENT_UPDATED, MODAL, MSG_TYPE_ERROR, MSG_TYPE_INFO, MSG_TYPE_LOG, NONE, REPORT_TYPE_CANCEL, REPORT_TYPE_DISPOSED, REPORT_TYPE_DONE, REPORT_TYPE_ERROR, REPORT_TYPE_INIT, REPORT_TYPE_MODE_CHANGE, REPORT_TYPE_PROPERTY_CHANGED, REPORT_TYPE_RETRY, REPORTER_TYPE_DEFAULT, REPORTER_VISIBILITY_SYSTEM, REPORTER_VISIBILITY_USER, RETVAL_OK, RETVAL_OK_TO_DISPOSE, SHOW_TOOLBAR, STANDALONE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionFileDownloadWindow
(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, boolean force_dialog) FileDownloadWindow
(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener) Create a file download window.private
FileDownloadWindow
(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener, Runnable callOnError) FileDownloadWindow
(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, Runnable runOnError) Create a file download window. -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getFileName
(String url) Brute-force extraction of the torrent file name or title from the given URLprivate String
getShortURL
(String url) Returns a shortened version of the given urlprivate boolean
private void
init()
private void
Initializes the reporter and show the download dialog if it is not suppressedvoid
TorrentDownloaderEvent
(int state, TorrentDownloader inf) private void
update()
-
Field Details
-
downloader
TorrentDownloader downloader -
listener
TorrentDownloaderCallBackInterface listener -
force_dialog
boolean force_dialog -
callOnError
-
pReporter
IProgressReporter pReporter -
parent
org.eclipse.swt.widgets.Shell parent -
original_url
String original_url -
decoded_url
String decoded_url -
referrer
String referrer -
request_properties
Map request_properties -
dirName
String dirName -
shortURL
String shortURL -
torrentOptions
TorrentOpenOptions torrentOptions -
lastState
private int lastState
-
-
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
-
-
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
- Specified by:
TorrentDownloaderEvent
in interfaceTorrentDownloaderCallBackInterface
-
update
private void update() -
getShortURL
Returns a shortened version of the given url- Parameters:
url
-- Returns:
-
getFileName
Brute-force extraction of the torrent file name or title from the given URL- Parameters:
url
-- Returns:
-