java获取config下文件

时间:2021-12-28 18:46:29
private static final String keystore="keystore.jks";
InputStream is=Thread.currentThread().getContextClassLoader().getResourceAsStream(keystore);
 
 
 
Properties property = new Properties();
property.load(zdwxTempApp.getClass().getClassLoader().getResourceAsStream(("config.properties")));
 
 
//解决中文乱码问题
Properties property = new Properties();
InputStream inputStream = ListenerP2PLogAPP.class.getResourceAsStream("/config.properties");  
BufferedReader bf = new BufferedReader(new InputStreamReader(inputStream));  
property.load(bf);