Package org.openstreetmap.josm.plugins
Class ReadLocalPluginInformationTask
java.lang.Object
org.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.plugins.ReadLocalPluginInformationTask
- All Implemented Interfaces:
Runnable,ProgressMonitor.CancelListener
This is an asynchronous task for reading plugin information from the files
in the local plugin repositories.
It scans the files in the local plugins repository (see
Preferences.getPluginsDirectory()
and extracts plugin information from three kind of files:
- .jar files, assuming that they represent plugin jars
- .jar.new files, assuming that these are downloaded but not yet installed plugins
- cached lists of available plugins, downloaded for instance from https://josm.openstreetmap.de/pluginicons
-
Field Summary
FieldsFields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newReadLocalPluginInformationTask.Constructs a newReadLocalPluginInformationTask. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidcancel()User pressed cancel button.protected voidprotected voidprotected voidfinish()Finish up the data work.Replies information about available plugins detected by this task.booleanReplies true if the task was canceled by the userprivate static File[]protected voidprocessJarFile(File f, String pluginName) protected voidprotected voidrealRun()Called in the worker thread to do the actual work.protected voidscanLocalPluginRepository(ProgressMonitor progressMonitor, File pluginsDirectory) protected voidscanPluginFiles(ProgressMonitor monitor, File pluginsDirectory) protected voidscanSiteCacheFiles(ProgressMonitor monitor, File pluginsDirectory) Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
Field Details
-
availablePlugins
-
canceled
-
-
Constructor Details
-
ReadLocalPluginInformationTask
public ReadLocalPluginInformationTask()Constructs a newReadLocalPluginInformationTask. -
ReadLocalPluginInformationTask
Constructs a newReadLocalPluginInformationTask.- Parameters:
monitor- progress monitor
-
-
Method Details
-
cancel
Description copied from class:PleaseWaitRunnableUser pressed cancel button.- Specified by:
cancelin classPleaseWaitRunnable
-
finish
Description copied from class:PleaseWaitRunnableFinish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.- Specified by:
finishin classPleaseWaitRunnable
-
processJarFile
- Throws:
PluginException
-
listFiles
-
scanSiteCacheFiles
-
scanPluginFiles
-
scanLocalPluginRepository
-
processLocalPluginInformationFile
- Throws:
PluginListParseException
-
analyseInProcessPlugins
-
filterOldPlugins
-
filterIrrelevantPlugins
-
realRun
Description copied from class:PleaseWaitRunnableCalled in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.- Specified by:
realRunin classPleaseWaitRunnable- Throws:
SAXException- if a SAX error occursIOException- if an I/O error occursOsmTransferException- if a communication error with the OSM server occurs
-
getAvailablePlugins
Replies information about available plugins detected by this task.- Returns:
- information about available plugins detected by this task.
-
isCanceled
Replies true if the task was canceled by the user- Returns:
- true if the task was canceled by the user
-