Package com.biglybt.ui.swt
Class FileDownloadWindow
- java.lang.Object
-
- com.biglybt.ui.swt.FileDownloadWindow
-
- All Implemented Interfaces:
TorrentDownloaderCallBackInterface
,IProgressReportConstants
public class FileDownloadWindow extends java.lang.Object implements TorrentDownloaderCallBackInterface, IProgressReportConstants
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Runnable
callOnError
(package private) java.lang.String
decoded_url
(package private) java.lang.String
dirName
(package private) TorrentDownloader
downloader
(package private) boolean
force_dialog
private int
lastState
(package private) TorrentDownloaderCallBackInterface
listener
(package private) java.lang.String
original_url
(package private) org.eclipse.swt.widgets.Shell
parent
(package private) IProgressReporter
pReporter
(package private) java.lang.String
referrer
(package private) java.util.Map
request_properties
(package private) java.lang.String
shortURL
(package private) TorrentOpenOptions
torrentOptions
-
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
Constructors Modifier Constructor Description FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, java.lang.String url, java.lang.String referrer, java.util.Map request_properties, boolean force_dialog)
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.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(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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
getFileName(java.lang.String url)
Brute-force extraction of the torrent file name or title from the given URLprivate java.lang.String
getShortURL(java.lang.String url)
Returns a shortened version of the given urlprivate boolean
handleByProtocol()
private void
init()
private void
setupAndShowDialog()
Initializes the reporter and show the download dialog if it is not suppressedvoid
TorrentDownloaderEvent(int state, TorrentDownloader inf)
private void
update()
-
-
-
Field Detail
-
downloader
TorrentDownloader downloader
-
listener
TorrentDownloaderCallBackInterface listener
-
force_dialog
boolean force_dialog
-
callOnError
private final java.lang.Runnable callOnError
-
pReporter
IProgressReporter pReporter
-
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
-
torrentOptions
TorrentOpenOptions torrentOptions
-
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
-
TorrentDownloaderEvent
public void TorrentDownloaderEvent(int state, TorrentDownloader inf)
- Specified by:
TorrentDownloaderEvent
in interfaceTorrentDownloaderCallBackInterface
-
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:
-
-