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

Similar Snippets


Creating Java Main Method Code Example - java

Find Duplicates In Arraylist Java Code Example - java

Java Creat A Folder Code Example - java

Firestore Find Doc And Set Data Code Example - java

Create Copy Of Array From Another Array Code Example - java