class WilmaAdminHostsFileParser {

    public void parseFile() {
        String filePath = propertyHolder.get(WILMA_ADMIN_HOSTS_FILE);
        List<String> wilmaAdminHosts = new ArrayList<>();
        boolean securityEnabled = !"".equals(filePath) && filePath != null;
        if (securityEnabled) {
            try (BufferedReader bufferedReader = bufferedReaderFactory.createBufferedReaderFromFilePath(filePath)) {
                while (bufferedReader.ready()) {
                    String host = bufferedReader.readLine();
                    wilmaAdminHosts.add(host);
                }
            } catch (IOException e) {
                throw new CannotParseExternalResourceException(String.format(ERROR_TEMPLATE, filePath), e);
            }
        }
        wilmaAdminHostsDTO.setWilmaAdminHosts(wilmaAdminHosts);
        wilmaAdminHostsDTO.setSecurityEnabled(securityEnabled);
    }

}