package com.ylcm.sys.common;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;

public class Config {
	
	private static Properties props = new Properties();
	
	static {
		try {
			props.load(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties"), Constants.ENCODING_UTF8));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	//得到配置信息
	public static String getValue(String key){
		
		String value = "";
		
		if (props.containsKey(key)) {
			value = props.getProperty(key).trim();
		}
		
		return value;
	}
}