<commit_before>package com.gmail.nossr50.config;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

import com.gmail.nossr50.mcMMO;

public abstract class ConfigLoader {
    protected static final mcMMO plugin = mcMMO.p;
    protected String fileName;
    protected File configFile;
    protected FileConfiguration config;

    public ConfigLoader(String relativePath, String fileName){
        this.fileName = fileName;
        configFile = new File(plugin.getDataFolder(), relativePath + File.separator + fileName);
        load();
    }

    public ConfigLoader(String fileName){
        this.fileName = fileName;
        configFile = new File(plugin.getDataFolder(), fileName);
        load();
    }

    protected void load() {
        if (!configFile.exists()) {
            plugin.getLogger().info("Creating mcMMO " + fileName + " File...");
            createFile();
        }
        else {
            plugin.getLogger().info("Loading mcMMO " + fileName + " File...");
        }

        config = YamlConfiguration.loadConfiguration(configFile);
    }

    protected abstract void loadKeys();

    protected void createFile() {
        if (configFile.exists()) {
            return;
        }

        configFile.getParentFile().mkdirs();

        InputStream inputStream = plugin.getResource(fileName);

        if (inputStream != null) {
            try {
                copyStreamToFile(inputStream, configFile);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        else {
            plugin.getLogger().severe("Missing ressource file: '" + configFile.getName() + "' please notify the plugin authors");
        }
    }

    private static void copyStreamToFile(InputStream inputStream, File file) throws Exception {
        OutputStream outputStream = new FileOutputStream(file);

        int read = 0;
        byte[] bytes = new byte[1024];

        while ((read = inputStream.read(bytes)) != -1) {
            outputStream.write(bytes, 0, read);
        }

        inputStream.close();
        outputStream.close();
    }
}<commit_msg>Removed unneeded method call<commit_after>package com.gmail.nossr50.config;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

import com.gmail.nossr50.mcMMO;

public abstract class ConfigLoader {
    protected static final mcMMO plugin = mcMMO.p;
    protected String fileName;
    protected File configFile;
    protected FileConfiguration config;

    public ConfigLoader(String relativePath, String fileName){
        this.fileName = fileName;
        configFile = new File(plugin.getDataFolder(), relativePath + File.separator + fileName);
        load();
    }

    public ConfigLoader(String fileName){
        this.fileName = fileName;
        configFile = new File(plugin.getDataFolder(), fileName);
        load();
    }

    protected void load() {
        if (!configFile.exists()) {
            plugin.getLogger().info("Creating mcMMO " + fileName + " File...");
            createFile();
        }
        else {
            plugin.getLogger().info("Loading mcMMO " + fileName + " File...");
        }

        config = YamlConfiguration.loadConfiguration(configFile);
    }

    protected abstract void loadKeys();

    protected void createFile() {
        if (configFile.exists()) {
            return;
        }

        configFile.getParentFile().mkdirs();

        InputStream inputStream = plugin.getResource(fileName);

        if (inputStream != null) {
            try {
                copyStreamToFile(inputStream, configFile);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        else {
            plugin.getLogger().severe("Missing ressource file: '" + fileName + "' please notify the plugin authors");
        }
    }

    private static void copyStreamToFile(InputStream inputStream, File file) throws Exception {
        OutputStream outputStream = new FileOutputStream(file);

        int read = 0;
        byte[] bytes = new byte[1024];

        while ((read = inputStream.read(bytes)) != -1) {
            outputStream.write(bytes, 0, read);
        }

        inputStream.close();
        outputStream.close();
    }
}
{'fraction_non_alphanumeric': 0.1076990568107041, 'fraction_numerical': 0.00482561965343277, 'mean_word_length': 2.4004474272930647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5008925', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1181, 'n_words': 281}