读取配置文件
来源:互联网 发布:员工技能矩阵管理办法 编辑:程序博客网 时间:2024/06/16 22:10
import java.io.IOException;import java.io.InputStream;import java.util.Properties;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class WeakPasswordConfig {private static Logger logger = LoggerFactory.getLogger(WeakPasswordConfig.class);private static final String FILE = "weakPassword.properties";private String weakPassword;public WeakPasswordConfig() {Properties p = new Properties();InputStream in = getClass().getResourceAsStream("/" + FILE); if (in == null) { logger.warn(FILE + "文件不存在"); return; }try {p.load(in);this.weakPassword = p.getProperty("weak.password").trim();} catch (IOException e) {logger.warn(FILE + "文件不存在");e.printStackTrace();}}public String getWeakPassword() {return weakPassword;}public void setWeakPassword(String weakPassword) {this.weakPassword = weakPassword;}}
阅读全文
0 0
- 读取配置文件
- 读取 配置文件
- 读取配置文件
- 读取配置文件
- 配置文件读取
- 配置文件读取
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 读取配置文件
- 配置文件读取
- 读取配置文件
- ZooKeeper实现分布式队列Queue
- CCF CSP 201609-1 最大波动
- APK 加壳方法
- 第10章_查找
- DFS && Cut twigs
- 读取配置文件
- win10+VS2015+pycaffe编译
- halcon12 字符分割(新)
- maven环境的配置及eclipse配置
- 正则表达式常用方法和构造摘要
- 各大搜索引擎算法的改变影响网站
- VC2012 新建文档点击保存时提示断言出错(见图),请问各位大神有什么办法解决此问题?
- Python爬取高清图片
- 电脑进行远程桌面连接