public class PluginDownloadTask extends PleaseWaitRunnable
getDownloadedPlugins()
replies the list of downloaded plugins
and getFailedPlugins()
replies the list of failed plugins.Modifier and Type | Field and Description |
---|---|
private boolean |
canceled |
private java.net.HttpURLConnection |
downloadConnection |
private java.util.Collection<PluginInformation> |
downloaded |
private java.util.Collection<PluginInformation> |
failed |
static java.lang.String |
PLUGIN_MIME_TYPES
The accepted MIME types sent in the HTTP Accept header.
|
private java.util.Collection<PluginInformation> |
toUpdate |
progressMonitor
Constructor and Description |
---|
PluginDownloadTask(java.awt.Component parent,
java.util.Collection<PluginInformation> toUpdate,
java.lang.String title)
Creates the download task
|
PluginDownloadTask(ProgressMonitor monitor,
java.util.Collection<PluginInformation> toUpdate,
java.lang.String title)
Creates the task
|
Modifier and Type | Method and Description |
---|---|
protected void |
cancel()
User pressed cancel button.
|
protected void |
download(PluginInformation pi,
java.io.File file) |
protected void |
finish()
Finish up the data work.
|
java.util.Collection<PluginInformation> |
getDownloadedPlugins()
Replies the list of plugins whose download has failed
|
java.util.Collection<PluginInformation> |
getFailedPlugins()
Replies the list of successfully downloaded plugins
|
boolean |
isCanceled()
Replies true if the task was canceled by the user
|
protected void |
realRun()
Called in the worker thread to do the actual work.
|
void |
setPluginsToDownload(java.util.Collection<PluginInformation> toUpdate)
Sets the collection of plugins to update.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
public static final java.lang.String PLUGIN_MIME_TYPES
private final java.util.Collection<PluginInformation> toUpdate
private final java.util.Collection<PluginInformation> failed
private final java.util.Collection<PluginInformation> downloaded
private boolean canceled
private java.net.HttpURLConnection downloadConnection
public PluginDownloadTask(java.awt.Component parent, java.util.Collection<PluginInformation> toUpdate, java.lang.String title) throws java.lang.IllegalArgumentException
parent
- the parent component relative to which the PleaseWaitDialog
is displayedtoUpdate
- a collection of plugin descriptions for plugins to update/download. Must not be null.title
- the title to display in the PleaseWaitDialog
java.lang.IllegalArgumentException
- thrown if toUpdate is nullpublic PluginDownloadTask(ProgressMonitor monitor, java.util.Collection<PluginInformation> toUpdate, java.lang.String title)
monitor
- a progress monitor. Defaults to NullProgressMonitor.INSTANCE
if nulltoUpdate
- a collection of plugin descriptions for plugins to update/download. Must not be null.title
- the title to display in the PleaseWaitDialog
java.lang.IllegalArgumentException
- thrown if toUpdate is nullpublic void setPluginsToDownload(java.util.Collection<PluginInformation> toUpdate) throws java.lang.IllegalArgumentException
toUpdate
- the collection of plugins to update. Must not be null.java.lang.IllegalArgumentException
- thrown if toUpdate is nullprotected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected void download(PluginInformation pi, java.io.File file) throws PluginDownloadException
PluginDownloadException
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
public boolean isCanceled()
true
if the task was stopped by the userpublic java.util.Collection<PluginInformation> getFailedPlugins()
public java.util.Collection<PluginInformation> getDownloadedPlugins()