<commit_before>package com.github.kory33.updatenotificationplugin.bukkit.config;

import java.io.File;

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

import com.github.kory33.updatenotificationplugin.bukkit.UpdateNotificationPlugin;

/**
 * Bukkit-configuration handler
 * @author Kory33
 *
 */
public class ConfigHandler {
    private static final String LOG_UP_TO_DATE_PATH = "logUpToDate";
    private static final String LOG_UPDATES_TO_SERVER = "logUpdatesToServer";
    private static final String UPDATE_CHECK_FREQUENT_PATH = "updateCheckFrequent";
    private static final String LOG_UPDATES_TO_NON_OP = "logUpdatesToNonOp";
    
    /** Path to the configuration file */
    private final FileConfiguration fConfiguration;
    
    
    public ConfigHandler(UpdateNotificationPlugin plugin, String configPath){
        if(!(new File(configPath)).exists()){
            plugin.saveResource(configPath, false);
        }
        
        File file = new File(plugin.getDataFolder(), configPath);
        this.fConfiguration = YamlConfiguration.loadConfiguration(file);
    }
    
    /**
     * Return true, in reference to the configuration file, if the plugin should log up-to-date status
     * @return value of {@value #LOG_UP_TO_DATE_PATH} in the config file
     */
    public boolean shouldLogUpToDate(){
        return this.fConfiguration.getBoolean(LOG_UP_TO_DATE_PATH, false);
    }
    
    /**
     * Return true, in reference to the configuration file, if the plugin should check for update frequently.
     * @return value of {@value #UPDATE_CHECK_FREQUENT_PATH} in the config file
     */
    public boolean isUpdateCheckFrequent(){
        return this.fConfiguration.getBoolean(UPDATE_CHECK_FREQUENT_PATH, false);
    }
    
    /**
     * Return true, in reference to the configuration file, if the plugin should log updates to the server console
     * @return value of {@value #UPDATE_CHECK_FREQUENT_PATH} in the config file
     */
    public boolean shouldLogToServer(){
        return this.fConfiguration.getBoolean(LOG_UPDATES_TO_SERVER, true);
    }

    public boolean shouldLogToNonOp() {
        return this.fConfiguration.getBoolean(LOG_UPDATES_TO_NON_OP, true);
    }
}
<commit_msg>added JavaDoc<commit_after>package com.github.kory33.updatenotificationplugin.bukkit.config;

import java.io.File;

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

import com.github.kory33.updatenotificationplugin.bukkit.UpdateNotificationPlugin;

/**
 * Bukkit-configuration handler
 * @author Kory33
 *
 */
public class ConfigHandler {
    private static final String LOG_UP_TO_DATE_PATH = "logUpToDate";
    private static final String LOG_UPDATES_TO_SERVER = "logUpdatesToServer";
    private static final String UPDATE_CHECK_FREQUENT_PATH = "updateCheckFrequent";
    private static final String LOG_UPDATES_TO_NON_OP = "logUpdatesToNonOp";
    
    /** Path to the configuration file */
    private final FileConfiguration fConfiguration;
    
    
    public ConfigHandler(UpdateNotificationPlugin plugin, String configPath){
        if(!(new File(configPath)).exists()){
            plugin.saveResource(configPath, false);
        }
        
        File file = new File(plugin.getDataFolder(), configPath);
        this.fConfiguration = YamlConfiguration.loadConfiguration(file);
    }
    
    /**
     * Return true, in reference to the configuration file, if the plugin should log up-to-date status
     * @return value of {@value #LOG_UP_TO_DATE_PATH} in the config file
     */
    public boolean shouldLogUpToDate(){
        return this.fConfiguration.getBoolean(LOG_UP_TO_DATE_PATH, false);
    }
    
    /**
     * Return true, in reference to the configuration file, if the plugin should check for update frequently.
     * @return value of {@value #UPDATE_CHECK_FREQUENT_PATH} in the config file
     */
    public boolean isUpdateCheckFrequent(){
        return this.fConfiguration.getBoolean(UPDATE_CHECK_FREQUENT_PATH, false);
    }
    
    /**
     * Return true, in reference to the configuration file, if the plugin should log updates to the server console
     * @return value of {@value #UPDATE_CHECK_FREQUENT_PATH} in the config file
     */
    public boolean shouldLogToServer(){
        return this.fConfiguration.getBoolean(LOG_UPDATES_TO_SERVER, true);
    }

    /**
     * Return true, in reference to the configuration file, if the plugin should log updates to non-op players
     * @return value of {@value #LOG_UPDATES_TO_NON_OP} in the config file
     */
    public boolean shouldLogToNonOp() {
        return this.fConfiguration.getBoolean(LOG_UPDATES_TO_NON_OP, true);
    }
}

{'fraction_non_alphanumeric': 0.07987421383647798, 'fraction_numerical': 0.0025157232704402514, 'mean_word_length': 3.596339113680154, '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': '4944840', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1334, 'n_words': 359}