package org.texttechnologylab.project.gruppe_05_1.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public abstract class PropertiesUtils {

    public static Properties readPropertiesFromResource(String propertiesFileName) {

        Properties properties = new Properties();
        try (InputStream input =  PropertiesUtils.class.getClassLoader().getResourceAsStream(propertiesFileName)) {
            if (null == input) {
                System.err.println("Properties-Datei '" + propertiesFileName + "' konnte nicht gelesen werden");
            }

            properties.load(input);
        } catch (IOException ioex) {
            System.err.println("Exception beim Lesen der properties-Datei '" + propertiesFileName + "': " + ioex.getLocalizedMessage());
        }

        return properties;
    }
}
