java resource file

Java
InputStream inputStream = getClass()
		.getClassLoader().getResourceAsStream("database.properties");File file = new File(
	getClass().getClassLoader().getResource("database.properties").getFile()
);
Source

Also in Java: