I was confused using the said method because while loading some properties file people are following a different approaches...
Properties prop
= new Proper
You can use the first approach if you are 100 % sure that the file location doesn't change across environments. This means there is a operations over head to make sure those directory paths are created across all environments. On the flip side, you have the flexibility of updating the properties file without opening the jar.
The second approach is very portable as you are reading from the classpath. But it has the disadvantage of re-bundling the jar file for every property update.
So, it basically depends upon your use-case.