<commit_before>package org.openbaton.vim.drivers.interfaces;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * Created by lto on 15/10/15.
 */
public abstract class VimDriver extends UnicastRemoteObject implements ClientInterfaces {
    protected VimDriver() throws RemoteException {
    }
}<commit_msg>added fetching of properties to use it inside the vim-driver plugins<commit_after>package org.openbaton.vim.drivers.interfaces;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Properties;


/**
 * Created by lto on 15/10/15.
 */
public abstract class VimDriver extends UnicastRemoteObject implements ClientInterfaces {

    private Logger log = LoggerFactory.getLogger(this.getClass());

    protected Properties properties;

    protected VimDriver() throws RemoteException {
        loadProperties();
    }

    public void loadProperties() {
        properties = new Properties();

        log.debug("Loading properties");
        try {
            properties.load(this.getClass().getResourceAsStream("/plugin.conf.properties"));
            if (properties.getProperty("external-properties-file") != null) {
                File externalPropertiesFile = new File(properties.getProperty("external-properties-file"));
                if (externalPropertiesFile.exists()) {
                    log.debug("Loading properties from external-properties-file: " + properties.getProperty("external-properties-file"));
                    InputStream is = new FileInputStream(externalPropertiesFile);
                    properties.load(is);
                } else {
                    log.debug("external-properties-file: " + properties.getProperty("external-properties-file") + " doesn't exist");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.debug("Loaded properties: " + properties);
    }

    public Properties getProperties() {
        return properties;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

}
{'fraction_non_alphanumeric': 0.1012216404886562, 'fraction_numerical': 0.006108202443280977, 'mean_word_length': 2.9671280276816607, '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': '3114840', 'n_tokens_mistral': 599, 'n_tokens_neox': 573, 'n_words': 130}