Class CustomHttpHeadersSettingsFile


  • public final class CustomHttpHeadersSettingsFile
    extends Object
    Manages reading and writing custom HTTP headers to and from a file config.
    Since:
    8.6.0
    • Constructor Detail

      • CustomHttpHeadersSettingsFile

        public CustomHttpHeadersSettingsFile()
    • Method Detail

      • write

        public static void write​(de.xima.cmn.props.FileBasedPropertiesConfiguration config,
                                 String key,
                                 List<SettingsNamedParam> customHttpHeaders)
        Writes custom HTTP headers into the configuration file.
        Parameters:
        config - config where the headers will be written
        key - key for save in config. If not present, defaults to DEFAULT_PREFIX_KEY
        customHttpHeaders - headers that will be written in config.
      • load

        public static List<SettingsNamedParam> load​(de.xima.cmn.props.FileBasedPropertiesConfiguration config,
                                                    String key)
        Retrieves custom HTTP headers from the file config.

        Storage format:

         system.header.custom.backend.0.name = name1
         system.header.custom.backend.0.value = value1
         system.header.custom.backend.1.name = name2
         system.header.custom.backend.1.value = value2
         

        IMPORTANT: Indices must follow a strict sequential order without gaps. The value below will be ignored because the next expected index in the sequence is 2:

         system.header.custom.backend.3.name = name3
         system.header.custom.backend.3.value = value3
         
        Parameters:
        config - HTTP headers quelle
        key - key for search headers. If not present, defaults to DEFAULT_PREFIX_KEY
        Returns:
        custom HTTP headers loaded from the config file;