<commit_before>package com.digistratum.microhost.Config;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class ConfigImpl implements Config {
	protected Map<String, String> config;

	/**
	 * Default constructor
	 */
	public ConfigImpl() {
		config = new HashMap<>();
	}

	/**
	 * Props loading constructor
	 *
	 * @param path String path to the properties file we want to load from
	 */
	public ConfigImpl(String path) {
		this();
		loadProperties(path);
	}

	/**
	 * Load properties from a specified path
	 *
	 * ref: https://www.mkyong.com/java/java-properties-file-examples/
	 *
	 * @param path String path to the properties file we want to load from
	 */
	protected void loadProperties(String path) {
		Properties prop = new Properties();
		InputStream input = null;

		try {
			input = new FileInputStream(path);

			// load a properties file
			prop.load(input);
		} catch (FileNotFoundException e) {
			System.out.println("Missing properties file: '" + path + "'");<commit_msg>Minor code refactoring for variable declaration<commit_after>package com.digistratum.microhost.Config;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class ConfigImpl implements Config {
	protected Map<String, String> config;

	/**
	 * Default constructor
	 */
	public ConfigImpl() {
		config = new HashMap<>();
	}

	/**
	 * Props loading constructor
	 *
	 * @param path String path to the properties file we want to load from
	 */
	public ConfigImpl(String path) {
		this();
		loadProperties(path);
	}

	/**
	 * Load properties from a specified path
	 *
	 * ref: https://www.mkyong.com/java/java-properties-file-examples/
	 *
	 * @param path String path to the properties file we want to load from
	 */
	protected void loadProperties(String path) {
		Properties prop = new Properties();

		try {
			InputStream input = new FileInputStream(path);

			// load a properties file
			prop.load(input);
		} catch (FileNotFoundException e) {
			System.out.println("Missing properties file: '" + path + "'");
{'fraction_non_alphanumeric': 0.11063094209161625, 'fraction_numerical': 0.0, 'mean_word_length': 3.873684210526316, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7659149', 'n_tokens_mistral': 712, 'n_tokens_neox': 646, 'n_words': 205}