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

org.esfinge.guardian.rbac.utils.RbacConfig Maven / Gradle / Ivy

There is a newer version: 1.2.3
Show newest version
package org.esfinge.guardian.rbac.utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Logger;

public class RbacConfig {

	private Properties prop;

	public RbacConfig() {
		prop = loadProperties();
	}

	public String getRolesKey() {
		return prop.getProperty("roles.key");
	}

	public String getDeclareRolesKey() {
		return prop.getProperty("declareRoles.key");
	}

	private Properties loadProperties() {
		if (prop == null) {
			prop = new Properties();
			try {
				prop.load(new FileInputStream("src/META-INF/services/RbacConfig.properties"));
			} catch (IOException e) {
				Logger.getLogger(this.getClass().getName(), "GuardianConfig could not be loaded: " + e);
			}
		}
		return prop;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy