# Class ConfigUtils

java.lang.Object
org.apache.zookeeper.server.util.ConfigUtils

public class ConfigUtils extends Object

## Constructor Summary

Constructors
Constructor
Description
`ConfigUtils()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`getClientConfigStr(String configData)`
`static String[]`
`getHostAndPort(String s)`
Gets host and port by splitting server config with support for IPv6 literals
`static String`
`getPropertyBackwardCompatibleWay(String newPropertyKey)`
Some old configuration properties are not configurable in zookeeper configuration file zoo.cfg.

### Methods inherited from class Object

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

## Constructor Details

### ConfigUtils

public ConfigUtils()

## Method Details

### getClientConfigStr

public static String getClientConfigStr(String configData)

### getHostAndPort

public static String[] getHostAndPort(String s) throws QuorumPeerConfig.ConfigException
Gets host and port by splitting server config with support for IPv6 literals

Parameters:
  `s` - server config, server:port
Returns:
  String[] first element being the IP address and the next being the port
Throws:
  `QuorumPeerConfig.ConfigException`

### getPropertyBackwardCompatibleWay

public static String getPropertyBackwardCompatibleWay(String newPropertyKey)
Some old configuration properties are not configurable in zookeeper configuration file zoo.cfg. To make these properties configurable in zoo.cfg old properties are prepended with zookeeper. For example prop.x.y.z changed to zookeeper.prop.x.y.z. But for backward compatibility both prop.x.y.z and zookeeper.prop.x.y.z should be supported. This method first gets value from new property, if first property is not configured then gets value from old property

Parameters:
  `newPropertyKey` - new property key which starts with zookeeper.
Returns:
  either new or old system property value. Null if none of the properties are set.