Little-Coder

代码结构如下:

demo

--src

--conf

----aaa.properties

 1 Properties props = new Properties();
 2 try {
 3     String url = RemoteFilter.class.getClassLoader().getResource("/").toURI().getPath()+"aaa.properties";
 4     InputStream in = new FileInputStream(new File(url));
 5     props.load(in);
 6 } catch (IOException e) {
 7     e.printStackTrace();
 8 } catch (URISyntaxException e) {
 9     e.printStackTrace();
10 }
11 
12 String value = props.getProperty("key");

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
  • 2021-06-09
  • 2021-10-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案