All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cybermkd.plugin.kit.ResourceKit Maven / Gradle / Ivy

The newest version!
package com.cybermkd.plugin.kit;

import com.google.common.base.Throwables;
import com.google.common.collect.Maps;
import com.google.common.io.Resources;

import java.io.InputStreamReader;
import java.net.URL;
import java.util.Map;
import java.util.Properties;

public class ResourceKit {
    public static Map readProperties(String resourceName) {
        Properties properties = new Properties();
        URL resource = Resources.getResource(resourceName);
        try {
            properties.load(new InputStreamReader(resource.openStream(), "UTF-8"));
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
        return Maps.fromProperties(properties);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy