net.i2p.router.web
Class NewsHelper

java.lang.Object
  extended by net.i2p.router.web.HelperBase
      extended by net.i2p.router.web.ContentHelper
          extended by 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
static String NEWS_FILE
           
static String PROP_LAST_CHECKED
           
static String PROP_LAST_UPDATE_TIME
           
static String PROP_LAST_UPDATED
           
 
Fields inherited from class net.i2p.router.web.ContentHelper
_page
 
Fields inherited from class net.i2p.router.web.HelperBase
_context, _out
 
Constructor Summary
NewsHelper()
           
 
Method Summary
static boolean dontInstall(RouterContext ctx)
           
 String getContent()
           
static String getUpdateStatus()
           
static boolean isAnyUpdateInProgress()
          If ANY update is in progress.
static boolean isUnsignedUpdateAvailable()
          Will be false if already downloaded
static boolean isUpdateAvailable()
          Will be false if already downloaded
static boolean isUpdateInProgress()
          If a signed or unsigned router update is in progress.
static long lastChecked(RouterContext ctx)
           
static long lastUpdated(RouterContext ctx)
          When the news was last downloaded
 boolean shouldShowNews()
          Is the news newer than the last time it was hidden?
static boolean shouldShowNews(RouterContext ctx)
           
 void showNews(boolean yes)
          Save config with the timestamp of the current news to hide, or 0 to show
static void showNews(RouterContext ctx, boolean yes)
          Save config with the timestamp of the current news to hide, or 0 to show
 String status()
           
static String status(RouterContext ctx)
           
static String unsignedUpdateVersion()
           
static String unsignedVersionDownloaded()
          Already downloaded but not installed version
static String updateVersion()
          Available version, will be null if already downloaded
static String updateVersionDownloaded()
          Already downloaded but not installed version
 
Methods inherited from class net.i2p.router.web.ContentHelper
getTextContent, setLang, setMaxLines, setPage, setStartAtBeginning
 
Methods inherited from class net.i2p.router.web.HelperBase
_, _, _, _x, ngettext, setContextId, storeWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

NEWS_FILE

public static final String NEWS_FILE
See Also:
Constant Field Values
Constructor Detail

NewsHelper

public NewsHelper()
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()
Will be false if already downloaded

Since:
0.9.4 moved from NewsFetcher

updateVersion

public static String updateVersion()
Available version, will be null if already downloaded

Returns:
null if none
Since:
0.9.4 moved from NewsFetcher

updateVersionDownloaded

public static String updateVersionDownloaded()
Already downloaded but not installed version

Returns:
null if none
Since:
0.9.4

isUnsignedUpdateAvailable

public static boolean isUnsignedUpdateAvailable()
Will be false if already downloaded

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

getUpdateStatus

public static String getUpdateStatus()
Returns:
"" if none
Since:
0.9.4 moved from UpdateHelper

getContent

public String getContent()
Overrides:
getContent in class ContentHelper

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

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