|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.plugins.ReadRemotePluginInformationTask
public class ReadRemotePluginInformationTask
An asynchronous task for downloading plugin lists from the configured plugin download sites.
Nested Class Summary | |
---|---|
protected static class |
ReadRemotePluginInformationTask.CacheType
|
Field Summary | |
---|---|
private java.util.List<PluginInformation> |
availablePlugins
|
private boolean |
canceled
|
private java.net.HttpURLConnection |
connection
|
private java.util.Collection<java.lang.String> |
sites
|
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
progressMonitor |
Constructor Summary | |
---|---|
ReadRemotePluginInformationTask(java.util.Collection<java.lang.String> sites)
Creates the task |
|
ReadRemotePluginInformationTask(ProgressMonitor monitor,
java.util.Collection<java.lang.String> sites)
Creates the task |
Method Summary | |
---|---|
protected void |
cachePluginList(java.lang.String site,
java.lang.String list)
Writes the list of plugins to a cache file |
protected void |
cancel()
User pressed cancel button. |
protected java.io.File |
createSiteCacheFile(java.io.File pluginDir,
java.lang.String site,
ReadRemotePluginInformationTask.CacheType type)
Creates the file name for the cached plugin list and the icon cache file. |
protected void |
downloadPluginIcons(java.lang.String site,
java.io.File destFile,
ProgressMonitor monitor)
Downloads the icon archive from a remote location |
protected java.lang.String |
downloadPluginList(java.lang.String site,
ProgressMonitor monitor)
Downloads the list from a remote location |
protected java.util.List<PluginInformation> |
filterDeprecatedPlugins(java.util.List<PluginInformation> plugins)
Filter information about deprecated plugins from the list of downloaded plugins |
protected void |
finish()
Finish up the data work. |
java.util.List<PluginInformation> |
getAvailabePlugins()
Replies the list of plugins described in the downloaded plugin lists |
protected void |
init(java.util.Collection<java.lang.String> sites)
|
boolean |
isCanceled()
Replies true if the task was canceled |
protected void |
parsePluginListDocument(java.lang.String site,
java.lang.String doc)
Parses the plugin list |
protected void |
realRun()
Called in the worker thread to do the actual work. |
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Collection<java.lang.String> sites
private boolean canceled
private java.net.HttpURLConnection connection
private java.util.List<PluginInformation> availablePlugins
Constructor Detail |
---|
public ReadRemotePluginInformationTask(java.util.Collection<java.lang.String> sites)
sites
- the collection of download sites. Defaults to the empty collection if null.public ReadRemotePluginInformationTask(ProgressMonitor monitor, java.util.Collection<java.lang.String> sites)
monitor
- the progress monitor. Defaults to NullProgressMonitor.INSTANCE
if nullsites
- the collection of download sites. Defaults to the empty collection if null.Method Detail |
---|
protected void init(java.util.Collection<java.lang.String> sites)
protected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected java.io.File createSiteCacheFile(java.io.File pluginDir, java.lang.String site, ReadRemotePluginInformationTask.CacheType type)
site
- the name of the sitetype
- icon cache or plugin list cache
protected java.lang.String downloadPluginList(java.lang.String site, ProgressMonitor monitor)
site
- the site URLmonitor
- a progress monitor
protected void downloadPluginIcons(java.lang.String site, java.io.File destFile, ProgressMonitor monitor)
site
- the site URLmonitor
- a progress monitorprotected void cachePluginList(java.lang.String site, java.lang.String list)
site
- the site from where the list was downloadedlist
- the downloaded listprotected java.util.List<PluginInformation> filterDeprecatedPlugins(java.util.List<PluginInformation> plugins)
plugins
- the plugin informations
protected void parsePluginListDocument(java.lang.String site, java.lang.String doc)
site
- the site from where the list was downloadeddoc
- the document with the plugin listprotected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
OsmTransferException
public boolean isCanceled()
public java.util.List<PluginInformation> getAvailabePlugins()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |