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

web.configuration.WebConfiguration Maven / Gradle / Ivy

package web.configuration;

import java.util.Properties;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import loader.PropertiesLoader;

@ManagedBean
@RequestScoped
public class WebConfiguration {

	private static final String propertieFileName = "WebConfiguration.properties";
	
	private PropertiesLoader loader = new PropertiesLoader();
	private Properties properties;
	
	public WebConfiguration() {
		properties = loader.getPropertiesFile(propertieFileName);
	}

	public String getIP() {
		
		String value = "web.application.ip";
		loader.verifyIfValueExists(properties, value);
		return this.loader.getProperty(this.properties, value);
	}
	
	public String getApplicationName() {
		
		String value = "web.application.name";
		loader.verifyIfValueExists(properties, value);
		return this.loader.getProperty(this.properties, value);
	}
	
	public String getEarProjectName() {
		String value = "web.application.ear.name";
		loader.verifyIfValueExists(properties, value);
		return this.loader.getProperty(this.properties, value);
	}
			
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy