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 final String`
  `PROPERTIES_CONFIG_FILE_DEF`
  `static final String`
  `PROPERTIES_CONFIG_FILE_KEY`
  `static final String`
  `TDSL_CONFIG_FILE_DEF`
  `static final String`
  `TDSL_CONFIG_FILE_KEY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConfigHolder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Path`
  `backupOldConfigFile(Path initPropsFile)`
  `Path`
  `getConfigFilePath()`
  `Map<String,Object>`
  `getProperties()`
  `Optional<String[]>`
  `loadConfiguration(String[] args)`
  `static void`
  `main(String[] args)`
  `static void`
  `removeIfExistsAnd(Map<String,Object> props, String oldKey, BiConsumer<BiConsumer<String,Object>,Object> consumer)`
  `static Optional`
  `renameIfExists(Map<String,Object> props, String oldKey, String newKey, Function<Object,Object> converter)`
  `void`
  `saveToDSLFile(File f)`
  `void`
  `setProperties(Map<String,Object> props)`
  `protected static boolean`
  `upgradeDSL(Map<String,Object> props)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### 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

- ## Constructor Details

  - ### ConfigHolder

    public ConfigHolder()

- ## Method Details

  - ### backupOldConfigFile

    public static Path backupOldConfigFile(Path initPropsFile) throws IOException
    Throws:
      `IOException`

  - ### main

    public static void main(String[] args) throws Exception
    Throws:
      `Exception`

  - ### 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)

  - ### upgradeDSL

    protected static boolean upgradeDSL(Map<String,Object> props)

  - ### loadConfiguration

    public Optional<String[]> loadConfiguration(String[] args) throws IOException, ConfigReader.ConfigException
    Throws:
      `IOException`
      `ConfigReader.ConfigException`

  - ### getProperties

    public Map<String,Object> getProperties()

  - ### setProperties

    public void setProperties(Map<String,Object> props)

  - ### saveToDSLFile

    public void saveToDSLFile(File f) throws IOException
    Throws:
      `IOException`

  - ### getConfigFilePath

    public Path getConfigFilePath()