package com.palmnest.application.core.util;

import java.io.InputStream;
import java.util.Properties;

/**
 * 配置文件处理工具
 *
 * @author yb
 * @date 2014-04-10
 */
public class PropertiesKit {

	public static String readPropertiesValue(String key, String configFileName) {
		Properties p = new Properties();
		try {
			InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream(configFileName);
			p.load(profile);
			String value = p.getProperty(key);
			profile.close();
			return value;
		} catch (Exception e) {
			System.out.println(">>>>key&configFileName:" + key + "&" + configFileName);
			System.out.println("logError:EcwxUtils readPropertiesValue occur error. " + e.getMessage());
			return null;
		}
	}

}
