Class ReadRemotePluginInformationTask

    • Constructor Detail

      • ReadRemotePluginInformationTask

        public ReadRemotePluginInformationTask​(java.util.Collection<java.lang.String> sites)
        Constructs a new ReadRemotePluginInformationTask.
        Parameters:
        sites - the collection of download sites. Defaults to the empty collection if null.
      • ReadRemotePluginInformationTask

        public ReadRemotePluginInformationTask​(ProgressMonitor monitor,
                                               java.util.Collection<java.lang.String> sites,
                                               boolean displayErrMsg)
        Constructs a new ReadRemotePluginInformationTask.
        Parameters:
        monitor - the progress monitor. Defaults to NullProgressMonitor.INSTANCE if null
        sites - the collection of download sites. Defaults to the empty collection if null.
        displayErrMsg - if true, a blocking error message is displayed in case of I/O exception.
    • Method Detail

      • init

        protected final void init​(java.util.Collection<java.lang.String> sites,
                                  boolean displayErrMsg)
      • finish

        protected void finish()
        Description copied from class: PleaseWaitRunnable
        Finish 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:
        finish in class PleaseWaitRunnable
      • createSiteCacheFile

        protected java.io.File createSiteCacheFile​(java.io.File pluginDir,
                                                   java.lang.String site)
        Creates the file name for the cached plugin list and the icon cache file.
        Parameters:
        pluginDir - directory of plugin for data storage
        site - the name of the site
        Returns:
        the file name for the cache file
      • downloadPluginList

        protected java.lang.String downloadPluginList​(java.lang.String site,
                                                      ProgressMonitor monitor)
        Downloads the list from a remote location
        Parameters:
        site - the site URL
        monitor - a progress monitor
        Returns:
        the downloaded list
      • displayErrorMessage

        private static void displayErrorMessage​(ProgressMonitor monitor,
                                                java.lang.String msg,
                                                java.lang.String details,
                                                java.lang.String title,
                                                java.lang.String firstMessage)
      • cachePluginList

        protected void cachePluginList​(java.lang.String site,
                                       java.lang.String list)
        Writes the list of plugins to a cache file
        Parameters:
        site - the site from where the list was downloaded
        list - the downloaded list
      • filterDeprecatedPlugins

        protected java.util.List<PluginInformationfilterDeprecatedPlugins​(java.util.List<PluginInformation> plugins)
        Filter information about deprecated plugins from the list of downloaded plugins
        Parameters:
        plugins - the plugin informations
        Returns:
        the plugin informations, without deprecated plugins
      • parsePluginListDocument

        protected void parsePluginListDocument​(java.lang.String site,
                                               java.lang.String doc)
        Parses the plugin list
        Parameters:
        site - the site from where the list was downloaded
        doc - the document with the plugin list
      • realRun

        protected void realRun()
                        throws org.xml.sax.SAXException,
                               java.io.IOException,
                               OsmTransferException
        Description copied from class: PleaseWaitRunnable
        Called 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:
        realRun in class PleaseWaitRunnable
        Throws:
        org.xml.sax.SAXException - if a SAX error occurs
        java.io.IOException - if an I/O error occurs
        OsmTransferException - if a communication error with the OSM server occurs
      • isCanceled

        public boolean isCanceled()
        Replies true if the task was canceled
        Returns:
        true if the task was stopped by the user
      • getAvailablePlugins

        public java.util.List<PluginInformationgetAvailablePlugins()
        Replies the list of plugins described in the downloaded plugin lists
        Returns:
        the list of plugins
        Since:
        5601