public ZKClientConfig toConfig(Path configFile) throws IOException, QuorumPeerConfig.ConfigException {
        String configString = toConfigString();
        Files.createDirectories(configFile.getParent());
        Path tempFile = Files.createTempFile(configFile.toAbsolutePath().getParent(), "." + configFile.getFileName(), ".tmp");
        Files.writeString(tempFile, configString);
        Files.move(tempFile, configFile, StandardCopyOption.ATOMIC_MOVE);
        return new ZKClientConfig(configFile.toString());
    }
Builder for ZK client configuration

@author bjorncs
zookeeper-client-common/src/main/java/com/yahoo/vespa/zookeeper/client/ZkClientConfigBuilder.java