Package net.i2p.router.web
Class NewsHelper
- java.lang.Object
-
- net.i2p.router.web.HelperBase
-
- net.i2p.router.web.ContentHelper
-
- net.i2p.router.web.NewsHelper
-
public class NewsHelper extends ContentHelper
If news file does not exist, use file from the initialNews directory in $I2P- Since:
- 0.8.2
-
-
Field Summary
Fields Modifier and Type Field Description static StringNEWS_FILEstatic StringPROP_LAST_CHECKEDstatic StringPROP_LAST_UPDATE_TIMEstatic StringPROP_LAST_UPDATEDstatic StringPROP_TRANSLATEDefault true-
Fields inherited from class net.i2p.router.web.ContentHelper
_page
-
Fields inherited from class net.i2p.router.web.HelperBase
_context, _out, CHECKED, PROP_ADVANCED, SELECTED
-
-
Constructor Summary
Constructors Constructor Description NewsHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringdevSU3UpdateConstraint()Translated message about new version available but constrainedstatic StringdevSU3UpdateVersion()static StringdevSU3VersionDownloaded()Already downloaded but not installed versionstatic booleandontInstall(RouterContext ctx)StringgetContent()If we haven't downloaded news yet, use the translated initial news filestatic StringgetUpdateStatus()static booleanisAnyUpdateInProgress()If ANY update is in progress.static booleanisBaseReadonly(RouterContext ctx)static booleanisDevSU3UpdateAvailable(RouterContext ctx)Will be false if already downloaded or if dev update disabled.static booleanisExternalRestartPending()A router update had been downloaded and handled by an UpdatePostProcessor.static booleanisUnsignedUpdateAvailable(RouterContext ctx)Will be false if already downloaded or if dev update disabled.static booleanisUpdateAvailable()Release update only.static booleanisUpdateDisabled(RouterContext ctx)static booleanisUpdateInProgress()If a signed or unsigned router update is in progress.static longlastChecked(RouterContext ctx)static longlastUpdated(RouterContext ctx)When the news was last downloadedbooleanshouldShowNews()Is the news newer than the last time it was hidden?static booleanshouldShowNews(RouterContext ctx)voidshowNews(boolean yes)Save config with the timestamp of the current news to hide, or 0 to showstatic voidshowNews(RouterContext ctx, boolean yes)Save config with the timestamp of the current news to hide, or 0 to showStringstatus()static Stringstatus(RouterContext ctx)static StringunsignedUpdateConstraint()Translated message about new version available but constrainedstatic StringunsignedUpdateVersion()static StringunsignedVersionDownloaded()Already downloaded but not installed versionstatic StringupdateConstraint()Release update only.static StringupdateVersion()Release update only.static StringupdateVersionDownloaded()Release update only.-
Methods inherited from class net.i2p.router.web.ContentHelper
getTextContent, setLang, setMaxLines, setPage, setStartAtBeginning
-
Methods inherited from class net.i2p.router.web.HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriter
-
-
-
-
Field Detail
-
PROP_LAST_UPDATE_TIME
public static final String PROP_LAST_UPDATE_TIME
- See Also:
- Constant Field Values
-
PROP_LAST_CHECKED
public static final String PROP_LAST_CHECKED
- Since:
- 0.9.4
- See Also:
- Constant Field Values
-
PROP_LAST_UPDATED
public static final String PROP_LAST_UPDATED
- Since:
- 0.9.4
- See Also:
- Constant Field Values
-
PROP_TRANSLATE
public static final String PROP_TRANSLATE
Default true- Since:
- 0.9.21
- See Also:
- Constant Field Values
-
NEWS_FILE
public static final String NEWS_FILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isAnyUpdateInProgress
public static boolean isAnyUpdateInProgress()
If ANY update is in progress.- Since:
- 0.9.4 was stored in system properties
-
isUpdateInProgress
public static boolean isUpdateInProgress()
If a signed or unsigned router update is in progress. Does NOT cover plugins, news, etc.- Since:
- 0.9.4 was stored in system properties
-
isUpdateAvailable
public static boolean isUpdateAvailable()
Release update only. Will be false if already downloaded.- Since:
- 0.9.4 moved from NewsFetcher
-
isExternalRestartPending
public static boolean isExternalRestartPending()
A router update had been downloaded and handled by an UpdatePostProcessor. It will provide wrapper-like function to install the update and restart after shutdown.- Since:
- 0.9.51
-
updateVersion
public static String updateVersion()
Release update only. Available version, will be null if already downloaded.- Returns:
- null if none
- Since:
- 0.9.4 moved from NewsFetcher
-
updateConstraint
public static String updateConstraint()
Release update only. Translated message about new version available but constrained- Returns:
- null if none
- Since:
- 0.9.9
-
unsignedUpdateConstraint
public static String unsignedUpdateConstraint()
Translated message about new version available but constrained- Returns:
- null if none
- Since:
- 0.9.23
-
devSU3UpdateConstraint
public static String devSU3UpdateConstraint()
Translated message about new version available but constrained- Returns:
- null if none
- Since:
- 0.9.23
-
updateVersionDownloaded
public static String updateVersionDownloaded()
Release update only. Already downloaded but not installed version.- Returns:
- null if none
- Since:
- 0.9.4
-
isUnsignedUpdateAvailable
public static boolean isUnsignedUpdateAvailable(RouterContext ctx)
Will be false if already downloaded or if dev update disabled.- Since:
- 0.9.4 moved from NewsFetcher
-
unsignedUpdateVersion
public static String unsignedUpdateVersion()
- Returns:
- null if none
- Since:
- 0.9.4 moved from NewsFetcher
-
unsignedVersionDownloaded
public static String unsignedVersionDownloaded()
Already downloaded but not installed version- Returns:
- null if none
- Since:
- 0.9.4
-
isDevSU3UpdateAvailable
public static boolean isDevSU3UpdateAvailable(RouterContext ctx)
Will be false if already downloaded or if dev update disabled.- Since:
- 0.9.20
-
devSU3UpdateVersion
public static String devSU3UpdateVersion()
- Returns:
- null if none
- Since:
- 0.9.20
-
devSU3VersionDownloaded
public static String devSU3VersionDownloaded()
Already downloaded but not installed version- Returns:
- null if none
- Since:
- 0.9.20
-
getUpdateStatus
public static String getUpdateStatus()
- Returns:
- "" if none
- Since:
- 0.9.4 moved from UpdateHelper
-
getContent
public String getContent()
If we haven't downloaded news yet, use the translated initial news file- Overrides:
getContentin classContentHelper
-
shouldShowNews
public boolean shouldShowNews()
Is the news newer than the last time it was hidden?- Since:
- 0.8.12
-
shouldShowNews
public static boolean shouldShowNews(RouterContext ctx)
- Since:
- 0.9.4
-
showNews
public void showNews(boolean yes)
Save config with the timestamp of the current news to hide, or 0 to show- Since:
- 0.8.12
-
showNews
public static void showNews(RouterContext ctx, boolean yes)
Save config with the timestamp of the current news to hide, or 0 to show- Since:
- 0.9.4
-
status
public String status()
- Returns:
- HTML
- Since:
- 0.9.4 moved from NewsFetcher
-
status
public static String status(RouterContext ctx)
- Returns:
- HTML
- Since:
- 0.9.4 moved from NewsFetcher
-
dontInstall
public static boolean dontInstall(RouterContext ctx)
- Since:
- 0.9.4 moved from NewsFetcher
-
isUpdateDisabled
public static boolean isUpdateDisabled(RouterContext ctx)
- Since:
- 0.9.9
-
isBaseReadonly
public static boolean isBaseReadonly(RouterContext ctx)
- Since:
- 0.9.9
-
lastChecked
public static long lastChecked(RouterContext ctx)
- Since:
- 0.9.4
-
lastUpdated
public static long lastUpdated(RouterContext ctx)
When the news was last downloaded- Since:
- 0.9.4
-
-