Class ConfigUtil
java.lang.Object
org.summerboot.jexpress.boot.config.ConfigUtil
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected static AppLifecycleListenerstatic final Stringstatic final Stringprotected StringBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic Pathstatic voidcreateConfigFile(Class<? extends JExpressConfig> c, File cfgConfigDir, String cfgName, boolean cliMode) getAsBindingAddress(Properties props, String key) booleangetAsBoolean(Properties props, String key, Boolean defaultValue) String[]getAsCSV(Properties props, String key, String defaultValue) doublegetAsDouble(Properties props, String key, Double defaultValue) floatgetAsFloat(Properties props, String key, Float defaultValue) intgetAsInt(Properties props, String key, Integer defaultValue) getAsKeyManagerFactory(Properties props, String configFolder, String keyFile, String storePwd, String keyAlias, String keyPwd) longgetAsLong(Properties props, String key, Long defaultValue) getAsPassword(Properties props, String key) Double[]getAsRangeDouble(Properties props, String key, Set<Double> filterCodeSet) Long[]getAsRangeLong(Properties props, String key, Set<Long> filterCodeSet) getAsString(Properties props, String key, String defaultValue) getAsTrustManagerFactory(Properties props, String configFolder, String keyFile, String storePwd) getError()static intloadConfig(ConfigUtil.ConfigLoadMode mode, org.apache.logging.log4j.Logger log, Locale defaultRB, File configFile, JExpressConfig cfg, Map<File, Runnable> cfgUpdateTasks, File cfgConfigDir) static intloadConfigs(ConfigUtil.ConfigLoadMode mode, org.apache.logging.log4j.Logger log, Locale defaultRB, Path configFolder, Map<String, JExpressConfig> configs, int CfgMonitorInterval, File cfgConfigDir) static voidsetConfigChangeListener(AppLifecycleListener listener) static intupdatePasswords(File configFile, File destFile, boolean encrypt)
-
Field Details
-
cfgListener
-
sb
-
cfgFile
-
ENCRYPTED_WARPER_PREFIX
- See Also:
-
DECRYPTED_WARPER_PREFIX
- See Also:
-
-
Constructor Details
-
ConfigUtil
-
-
Method Details
-
cfgRoot
-
setConfigChangeListener
-
loadConfigs
public static int loadConfigs(ConfigUtil.ConfigLoadMode mode, org.apache.logging.log4j.Logger log, Locale defaultRB, Path configFolder, Map<String, JExpressConfig> configs, int CfgMonitorInterval, File cfgConfigDir) throws Exception- Throws:
Exception
-
createConfigFile
public static void createConfigFile(Class<? extends JExpressConfig> c, File cfgConfigDir, String cfgName, boolean cliMode) throws IOException - Throws:
IOException
-
loadConfig
public static int loadConfig(ConfigUtil.ConfigLoadMode mode, org.apache.logging.log4j.Logger log, Locale defaultRB, File configFile, JExpressConfig cfg, Map<File, Runnable> cfgUpdateTasks, File cfgConfigDir) throws Exception- Throws:
Exception
-
addError
-
getError
-
getAsBoolean
- Parameters:
props-key-defaultValue- the default value if value is not specified in props, null means required and no default value- Returns:
-
getAsInt
- Parameters:
props-key-defaultValue- the default value if value is not specified in props, null means required and no default value- Returns:
-
getAsLong
- Parameters:
props-key-defaultValue- the default value if value is not specified in props, null means required and no default value- Returns:
-
getAsFloat
- Parameters:
props-key-defaultValue- the default value if value is not specified in props, null means required and no default value- Returns:
-
getAsDouble
- Parameters:
props-key-defaultValue- the default value if value is not specified in props, null means required and no default value- Returns:
-
getAsString
- Parameters:
props-key-defaultValue- the default value if value is not specified in props, null means required and no default value- Returns:
-
getAsCSV
- Parameters:
props-key-defaultValue- the default value if value is not specified in props, null means required and no default value- Returns:
-
getAsRangeLong
-
getAsRangeDouble
-
getAsPassword
-
updatePasswords
public static int updatePasswords(File configFile, File destFile, boolean encrypt) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
getAsBindingAddress
-
getAsKeyManagerFactory
public KeyManagerFactory getAsKeyManagerFactory(Properties props, String configFolder, String keyFile, String storePwd, String keyAlias, String keyPwd) -
getAsTrustManagerFactory
public TrustManagerFactory getAsTrustManagerFactory(Properties props, String configFolder, String keyFile, String storePwd) -
getFile
-