Source:
private void init() throws KuraException { File configFile = new File(persistentConfigFileName); if (configFile.exists() || !isForwardOnlyConfiguration(configFile)) { logger.debug("There is no current DNS server configuration that allows forwarding"); return; } logger.debug("initing DNS Server configuration"); Set<IP4Address> forwarders = new HashSet<>(); Set<NetworkPair<IP4Address>> allowedNetworks = new HashSet<>(); try (FileReader fr = new FileReader(configFile); BufferedReader br = new BufferedReader(fr)) { String line; while ((line = br.readLine()) != null) { StringTokenizer st = new StringTokenizer(line); while (st.hasMoreTokens()) { String token = st.nextToken(); if ("forwarders".equals(token)) { StringTokenizer st2 = new StringTokenizer(st.nextToken(), "{} ;"); while (st2.hasMoreTokens()) { String forwarder = st2.nextToken(); if (forwarder != null && !"".equals(forwarder.trim())) { logger.debug("found forwarder: {}", forwarder); forwarders.add((IP4Address) IPAddress.parseHostAddress(forwarder)); } } } else if ("allow-query".equals(token)) { StringTokenizer st2 = new StringTokenizer(st.nextToken(), "{} ;"); while (st2.hasMoreTokens()) { String allowedNetwork = st2.nextToken(); if (allowedNetwork != null && !"".equals(allowedNetwork.trim())) { String[] splitNetwork = allowedNetwork.split("/"); allowedNetworks.add(new NetworkPair<IP4Address>( (IP4Address) IPAddress.parseHostAddress(splitNetwork[0]), Short.parseShort(splitNetwork[1]))); } } } } } this.dnsServerConfigIP4 = new DnsServerConfigIP4(forwarders, allowedNetworks); } catch (Exception e) { logger.error("init() :: failed to read the configuration file ", configFile.getName(), e); throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } }

Target:
private void init() throws KuraException { File configFile = new File(persistentConfigFileName); if (!configFile.exists() || !isForwardOnlyConfiguration(configFile)) { logger.debug("There is no current DNS server configuration that allows forwarding"); return; } logger.debug("initing DNS Server configuration"); Set<IP4Address> forwarders = new HashSet<>(); Set<NetworkPair<IP4Address>> allowedNetworks = new HashSet<>(); try (FileReader fr = new FileReader(configFile); BufferedReader br = new BufferedReader(fr)) { String line; while ((line = br.readLine()) != null) { StringTokenizer st = new StringTokenizer(line); while (st.hasMoreTokens()) { String token = st.nextToken(); if ("forwarders".equals(token)) { StringTokenizer st2 = new StringTokenizer(st.nextToken(), "{} ;"); while (st2.hasMoreTokens()) { String forwarder = st2.nextToken(); if (forwarder != null && !"".equals(forwarder.trim())) { logger.debug("found forwarder: {}", forwarder); forwarders.add((IP4Address) IPAddress.parseHostAddress(forwarder)); } } } else if ("allow-query".equals(token)) { StringTokenizer st2 = new StringTokenizer(st.nextToken(), "{} ;"); while (st2.hasMoreTokens()) { String allowedNetwork = st2.nextToken(); if (allowedNetwork != null && !"".equals(allowedNetwork.trim())) { String[] splitNetwork = allowedNetwork.split("/"); allowedNetworks.add(new NetworkPair<IP4Address>( (IP4Address) IPAddress.parseHostAddress(splitNetwork[0]), Short.parseShort(splitNetwork[1]))); } } } } } this.dnsServerConfigIP4 = new DnsServerConfigIP4(forwarders, allowedNetworks); } catch (Exception e) { logger.error("init() :: failed to read the configuration file ", configFile.getName(), e); throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } }