I was confused using the said method because while loading some properties file people are following a different approaches...
Properties prop
= new Proper
When you are reading a file from the Jar. Please use classloader's getResource or getResoureAsstream. Find the below code snippet to read a file from Jar. The above approaches cannot read a file from jar.
InputStream in = this.getClass().getClassLoader()
.getResourceAsStream("com/net/resources/config.properties");
InputStream is = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("com/net/resources/config.properties");
URL url = this.getClass().getClassLoader()
.getResource("com/net/resources/config.properties");