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