Class PersistNews

java.lang.Object
net.i2p.router.news.PersistNews

class PersistNews extends Object
Store and retrieve news entries from disk. Each entry is stored in a separate file, with the name derived from the UUID.
Since:
0.9.23
  • Constructor Details

    • PersistNews

      PersistNews()
  • Method Details

    • store

      public static boolean store(I2PAppContext ctx, List<Node> entries)
      Store each entry. Old entries are always overwritten, as they may change even without the updated date changing.
      Parameters:
      entries - each one should be "entry" at the root
      Returns:
      true if any new entry was written (not if changed)
    • load

      public static List<NewsEntry> load(I2PAppContext ctx)
      This does not check for any missing values. Any fields in any NewsEntry may be null. Content is not sanitized by NewsXMLParser here, do that before storing.
      Returns:
      non-null, sorted by updated date, newest first
    • delete

      public static boolean delete(I2PAppContext ctx, NewsEntry entry)
      Unused for now, as we don't have any way to remember it's deleted.
      Returns:
      success