class Environment {

    void reloadAccountabilityConfiguration(InputStream defaultConfigInputStream) {
        if (configFile != null) {
            File tempFile = new File(configFile.getParent(), "wineryAccountability.yml");
            try {
                FileUtils.copyInputStreamToFile(defaultConfigInputStream, tempFile);
            } catch (IOException e) {
                LOGGER.debug("Error copying default file", e);
            }
            YAMLConfiguration defaultAccountabilityConfiguration;
            try (FileReader reader = new FileReader(tempFile)) {
                String accountabilityPrefix = "accountability";
                defaultAccountabilityConfiguration = new YAMLConfiguration();
                defaultAccountabilityConfiguration.read(reader);
                YAMLConfiguration currentConfiguration = this.getConfiguration();
                Iterator<String> accountabilityAttributes = defaultAccountabilityConfiguration.getKeys(accountabilityPrefix);
                accountabilityAttributes.forEachRemaining(key ->
                    currentConfiguration.setProperty(key, defaultAccountabilityConfiguration.getString(key)));
                this.save();
            } catch (Exception e) {
                LOGGER.warn("Error while reading accountability configuration file", e);
            }
            FileUtils.deleteQuietly(tempFile);
        }
    }

    private  Environment();

}