/**
 * 
 */
package com.zhiweidata.bjfzxWebapp.util;

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

import org.apache.log4j.Logger;


/** 
 * @Description: 读取配置文件的工具类 
 * @author Tou Tang
 * @date 2014-11-14 下午3:06:33  
 */
public class PropertiesUtil {

	/**
	 * 
	* @Description: 读取配置文件
	* @param 
	* @return Properties
	 */
	public static Properties getProperties(String configName) {
		Properties pro = null;
		InputStream is = null;
		try {
			is = Thread.currentThread().getContextClassLoader().getResourceAsStream(configName);
			pro = new Properties();
			pro.load(is);
		} catch (Exception e) {
			log.error(e.getMessage());
		} finally {
			try {
				if (is != null) {
					is.close();
				}
			} catch (IOException e) {
				log.error(e.getMessage());
			}
		}
		return pro;
	}
	
	static Logger log = Logger.getLogger(PropertiesUtil.class.getName());

}
