package org.fouram.core.util;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class ConfConfig {

	private static final ResourceBundle RESOURCE_CONFIG = ResourceBundle.getBundle("config");

	public static String getConfigString(String key) {
		try {
			return RESOURCE_CONFIG.getString(key);
		} catch (MissingResourceException e) {
		}
		return '!' + key + '!';
	}

	public static Integer getConfigInteger(String key) {
		try {
			return Integer.valueOf(RESOURCE_CONFIG.getString(key));
		} catch (MissingResourceException e) {
		}
		return null;
	}
	
	public static boolean isTest(){
		return !"1".equals(getConfigString("environment"));
	}
}
