Java How To Get Files In Resources Code Example

Snippet 1

  File file = new File(
 getClass().getClassLoader().getResource("database.properties").getFile()
); 

Snippet 2

  InputStream inputStream = getClass()
  .getClassLoader().getResourceAsStream("database.properties"); 

Copyright © Code Fetcher 2020

 

 

Published

Leave a comment

Your email address will not be published. Required fields are marked *