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");