All Implemented Interfaces:
Checker, Updater

public class NewsHandlerextends UpdateHandler implements Checker
Task to periodically look for updates to the news.xml, and to keep track of whether that has an announcement for a new version.

Overrides UpdateRunner for convenience, this is not an Updater.

  • Field Details

    • DEFAULT_BACKUP_NEWS_URL_SU3

      private static final String DEFAULT_BACKUP_NEWS_URL_SU3
      Fallback news feed URL for SU3 updates.
      See Also:
    • PROP_BACKUP_NEWS_URL_SU3

      private static final String PROP_BACKUP_NEWS_URL_SU3
      Property overriding the fallback news feed URL
      See Also:
  • Constructor Details

    • NewsHandler

      public NewsHandler(RouterContext ctx, ConsoleUpdateManager mgr)
      Creates the news update checker for the given update manager.
      Parameters:
      ctx - the router context for the news fetcher
      mgr - the update manager that runs the fetched update tasks
  • Method Details

    • check

      public UpdateTask check(UpdateType type, UpdateMethod method, String id, String currentVersion, long maxTime)
      This will check for news or router updates (it does the same thing). Should not block.
      Specified by:
      check in interface Checker
      Parameters:
      type - the kind of update to look for, e.g. UpdateType.ROUTER_SIGNED
      method - the transport to fetch it over, e.g. UpdateMethod.HTTP
      id - plugin name or ignored
      currentVersion - ignored, stored locally
      maxTime - how long you have
      Returns:
      active task or null if unable to check
    • main

      public static void main(String[] args)
      CLI fetch.
      Parameters:
      args - command line arguments: -p proxy port, -l language, -u override news URL
    • test

      private static void test(I2PAppContext ctx, String phost, int pport, String url, File file)
      CLI fetch.
      Parameters:
      ctx - the context for the HTTP client
      phost - the proxy host, or null for no proxy
      pport - the proxy port, ignored without a proxy
      url - the news SU3 URL to fetch
      file - the local file to write the download to