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 HttpClient |
downloadConnection |
private java.util.Collection<PluginInformation> |
downloaded |
private java.util.Collection<PluginInformation> |
failed |
private java.lang.Exception |
lastException |
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 successfully downloaded plugins.
|
java.util.Collection<PluginInformation> |
getFailedPlugins()
Replies the list of plugins whose download has failed.
|
java.lang.Exception |
getLastException()
Replies the last exception that occurred during download, or
null. |
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, runpublic 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 java.lang.Exception lastException
private boolean canceled
private HttpClient downloadConnection
public PluginDownloadTask(java.awt.Component parent, java.util.Collection<PluginInformation> toUpdate, java.lang.String title)
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 PleaseWaitDialogjava.lang.IllegalArgumentException - 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 PleaseWaitDialogjava.lang.IllegalArgumentException - if toUpdate is nullpublic void setPluginsToDownload(java.util.Collection<PluginInformation> toUpdate)
toUpdate - the collection of plugins to update. Must not be null.java.lang.IllegalArgumentException - if toUpdate is nullprotected void cancel()
PleaseWaitRunnablecancel in class PleaseWaitRunnableprotected void finish()
PleaseWaitRunnablefinish in class PleaseWaitRunnableprotected void download(PluginInformation pi, java.io.File file) throws PluginDownloadException
PluginDownloadExceptionprotected void realRun() throws org.xml.sax.SAXException, java.io.IOException
PleaseWaitRunnablerealRun in class PleaseWaitRunnableorg.xml.sax.SAXException - if a SAX error occursjava.io.IOException - if an I/O error occurspublic boolean isCanceled()
true if the task was stopped by the userpublic java.util.Collection<PluginInformation> getFailedPlugins()
public java.util.Collection<PluginInformation> getDownloadedPlugins()
public java.lang.Exception getLastException()
null.null