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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigHolder()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 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

  - ### Constructor Detail

    - #### ConfigHolder

          public ConfigHolder()

  - ### Method Detail

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

Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.