Package tigase.conf
Class ConfigHolder
- java.lang.Object
-
- tigase.conf.ConfigHolder
-
public class ConfigHolder extends Object
Created by andrzej on 18.09.2016.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTIES_CONFIG_FILE_DEFstatic StringPROPERTIES_CONFIG_FILE_KEYstatic StringTDSL_CONFIG_FILE_DEFstatic StringTDSL_CONFIG_FILE_KEY
-
Constructor Summary
Constructors Constructor Description ConfigHolder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PathbackupOldConfigFile(Path initPropsFile)PathgetConfigFilePath()Map<String,Object>getProperties()Optional<String[]>loadConfiguration(String[] args)static voidmain(String[] args)static voidremoveIfExistsAnd(Map<String,Object> props, String oldKey, BiConsumer<BiConsumer<String,Object>,Object> consumer)static OptionalrenameIfExists(Map<String,Object> props, String oldKey, String newKey, Function<Object,Object> converter)voidsaveToDSLFile(File f)voidsetProperties(Map<String,Object> props)protected static booleanupgradeDSL(Map<String,Object> props)
-
-
-
Field Detail
-
PROPERTIES_CONFIG_FILE_DEF
public static final String PROPERTIES_CONFIG_FILE_DEF
- See Also:
- Constant Field Values
-
PROPERTIES_CONFIG_FILE_KEY
public static final String PROPERTIES_CONFIG_FILE_KEY
- See Also:
- Constant Field Values
-
TDSL_CONFIG_FILE_DEF
public static final String TDSL_CONFIG_FILE_DEF
-
TDSL_CONFIG_FILE_KEY
public static final String TDSL_CONFIG_FILE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
backupOldConfigFile
public static Path backupOldConfigFile(Path initPropsFile) throws IOException
- Throws:
IOException
-
removeIfExistsAnd
public static void removeIfExistsAnd(Map<String,Object> props, String oldKey, BiConsumer<BiConsumer<String,Object>,Object> consumer)
-
renameIfExists
public static Optional renameIfExists(Map<String,Object> props, String oldKey, String newKey, Function<Object,Object> converter)
-
loadConfiguration
public Optional<String[]> loadConfiguration(String[] args) throws IOException, ConfigReader.ConfigException
-
saveToDSLFile
public void saveToDSLFile(File f) throws IOException
- Throws:
IOException
-
getConfigFilePath
public Path getConfigFilePath()
-
-