Package net.i2p.router.news
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 Summary
Constructors Constructor Description PersistNews()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
delete(I2PAppContext ctx, NewsEntry entry)
Unused for now, as we don't have any way to remember it's deleted.static List<NewsEntry>
load(I2PAppContext ctx)
This does not check for any missing values.static boolean
store(I2PAppContext ctx, List<Node> entries)
Store each entry.
-
-
-
Method Detail
-
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:
- success
-
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
-
-