target/classes/com/phms/utils/PropertyUtil.java

(完整代码) 1KB

package com.phms.utils;

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

/**
 * class name:PropertyUtil <BR>
 */
public class PropertyUtil {

	/** 读取src下sender.properties配置文件内容 */
	private final static String CONFIGURE_LOCATION = "config.properties";
	/** 接收Properties内容 */
	private final static Properties property = new Properties();

	/**
	 * Method name: getConfigureProperties <BR>
	 * Description: 读取src下第三方配置文件thirdConfig.properties配置文件内容 <BR>
	 * Remark: <BR>
	 * 
	 * @param propertyName
	 * @return String<BR>
	 */
	public static String getConfigureProperties(String propertyName) {
		try {
			InputStreamReader in = new InputStreamReader(
					PropertyUtil.class.getClassLoader().getResourceAsStream(CONFIGURE_LOCATION), "UTF-8");
			property.load(in);
			String result = property.getProperty(propertyName);
			if (null != result && !"".equalsIgnoreCase(result)) {
				return result.trim();
			} else {
				return null;
			}
		} catch (IOException e) {
			e.printStackTrace();
			return null;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。