<commit_before>
package com.cardshifter.core.modloader;

import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Objects;
import java.util.Properties;

/**
 *
 * @author <NAME>
 */
final class ModLoaderHelper {
	private ModLoaderHelper() {
		throw new UnsupportedOperationException();
	}
	
	static String getConfigurationFileName() {
		return "configuration.properties";
	}
	
	static Properties getConfiguration(final Path modDirectory) throws IOException {
		Objects.requireNonNull(modDirectory, "modDirectory");
		Properties properties = new Properties();
		try (FileInputStream fileInputStream = new FileInputStream(modDirectory.resolve(getConfigurationFileName()).toFile())) {
			properties.load(fileInputStream);
		}
		return properties;
	}
}
<commit_msg>Added requirement that the Path argument of ModLoaderHelper.getConfiguration must be a directory.<commit_after>
package com.cardshifter.core.modloader;

import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Objects;
import java.util.Properties;

/**
 *
 * @author <NAME>
 */
final class ModLoaderHelper {
	private ModLoaderHelper() {
		throw new UnsupportedOperationException();
	}
	
	static String getConfigurationFileName() {
		return "configuration.properties";
	}
	
	static Properties getConfiguration(final Path modDirectory) throws IOException {
		Objects.requireNonNull(modDirectory, "modDirectory");
		if (!Files.isDirectory(modDirectory)) {
			throw new IllegalArgumentException("modDirectory " + modDirectory + " must be a directory");
		}
		Properties properties = new Properties();
		try (FileInputStream fileInputStream = new FileInputStream(modDirectory.resolve(getConfigurationFileName()).toFile())) {
			properties.load(fileInputStream);
		}
		return properties;
	}
}

{'fraction_non_alphanumeric': 0.10320855614973262, 'fraction_numerical': 0.0, 'mean_word_length': 5.706093189964157, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1698177', 'n_tokens_mistral': 519, 'n_tokens_neox': 488, 'n_words': 121}