I am testing(JUnit) a logic within a class residing somewhere under the main directory.
In that logic, I am trying to get the path of "dir3" by doing something like
this.getClass().getClassLoader().getResource("dir1/dir2/dir3").getPath()
but, the loader can not seem to find it.
When I rewrite the code to
this.getClass().getClassLoader().getResource("dir1/dir2").getPath()
it works.
Can't I have the loader find the correct directly path(dir3)?
Directory streucture(Maven)
src
|-main
| |-resources
| |-dir1
| |-dir2
| |-dir3
|-test
|-resources(empty)