java.lang.Object
i2p.susi.dns.BaseBean
- Direct Known Subclasses:
AddressbookBean, BlacklistBean, ConfigBean, LogBean, SubscriptionsBean
Holds methods common to several Beans.
Field Summary
Modifier and TypeFieldDescriptionprotected final I2PAppContextThe I2P application context.protected StringThe current action.private static final StringDirectory holding the addressbook files.private static final StringBase path of the theme files.private static final StringName of the addressbook config file.private longWhen the config file was last loaded.private static final StringDefault path of the private address book.private static final StringThe theme used by default.protected StringThe last serial number for CSRF.protected StringThe HTTP method.private static final StringConfig key of the private address book.static final StringProperty for password enable.private static final StringAddressbook key of the theme name.protected final PropertiesThe configuration properties.private static final StringConfig key enabling the Sora font.private static final StringRouter console key of the theme name.protected StringThe serial number.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprotected static StringTranslate a string.protected static StringTranslate a string with one parameter.protected static StringTranslate a string with two parameters.protected FileReturns the addressbook directory.protected FileThe addressbook configuration file.protected voidLog a debug message.Get the action.Generate a new random serial for CSRF protection and clear the pending action.getTheme()Returns the theme path.The configured console theme name.String[]Get all themes.booleanDetermine if a user-provided override.css file is active.protected voidLoads the configuration if needed.protected static StringTranslate a string with plural form (ngettext).protected voidreload()Reloads the configuration from file.voidSets the action.voidSets the serial.voidstoreMethod(String method) Store the HTTP method.booleanChecks if Sora font should be used.protected voidLog a warning message.
Field Details
_context
The I2P application context.properties
The configuration properties.action
The current action.lastSerial
The last serial number for CSRF.serial
The serial number.method
The HTTP method.configLastLoaded
private long configLastLoadedWhen the config file was last loaded.PRIVATE_BOOK
Config key of the private address book.- See Also:
DEFAULT_PRIVATE_BOOK
Default path of the private address book.- See Also:
RC_PROP_THEME_NAME
Router console key of the theme name.- See Also:
PROP_THEME_NAME
Addressbook key of the theme name.- See Also:
DEFAULT_THEME
BASE_THEME_PATH
Base path of the theme files.- See Also:
PROP_PW_ENABLE
Property for password enable.- See Also:
RC_PROP_ENABLE_SORA_FONT
Config key enabling the Sora font.- See Also:
ADDRESSBOOK_DIR
Directory holding the addressbook files.- See Also:
CONFIG_FILE
Name of the addressbook config file.- See Also:
Constructor Details
BaseBean
public BaseBean()Default constructor. Initializes the I2P context and properties.
Method Details
addressbookDir
configFile
loadConfig
protected void loadConfig()Loads the configuration if needed.reload
protected void reload()Reloads the configuration from file.getTheme
getThemeName
The configured console theme name.- Returns:
- the theme name, never null, falling back to the default theme
getThemes
useSoraFont
public boolean useSoraFont()Checks if Sora font should be used.- Returns:
- true if Sora font is enabled
isOverrideCssActive
public boolean isOverrideCssActive()Determine if a user-provided override.css file is active.- Returns:
- true if override.css is active
getAction
setAction
Sets the action. HTML is stripped from the value.- Parameters:
action- the action string
getSerial
Generate a new random serial for CSRF protection and clear the pending action.- Returns:
- a new serial number
setSerial
Sets the serial. HTML is stripped from the value.- Parameters:
serial- the serial number
storeMethod
_t
_t
_t
ngettext
debug
warn