How can I get the relative path of the folders in my project using code?
I\'ve created a new folder in my project and I want its relative path so no matter where the
Make use of the classpath.
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); URL url = classLoader.getResource("path/to/folder"); File file = new File(url.toURI()); // ...