I have the following code
Properties influxProps = new Properties();
InputStream inputStream = this.getClass().getResourceAsStream("/influx.properties");
String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
System.out.println("INFLUX PROPERTIES : "+result);
influxProps.load(inputStream);
System.out.println("Properties: "+influxProps.toString());
I am able to fetch the file and the result also displays the contents of the file correctly.
But loading of the input stream into influx properties doesn't work. When I try to print out the properties map it prints out nothing.
How do I resolve this. I am not running this code inside a static method.