There is the following file structure, where the module nested-maven-folder is marked as a submodule pom.xml top-maven-folder.

top-maven-folder ......pom.xml ......nested-special-folder ......nested-maven-folder ............pom.xml ............some-file.xml ............folder-with-java-classes 

How to access the folder nested-special-folder from a class in folder-with-java-classes?

I reasoned like this: if we look at the internal file, for example, some-file.xml we can write this name directly like this, then to call the level above we write something like ..\nested-special-folder . However, it did not work!

  • while I used such a crutch, it seems to work .. new File(".").getAbsoluteFile().getParentFile().getParentFile().getAbsolutePath() + System.getProperty("file.separator") + "nested-special-folder" - TheSN
  • ./../nested-special-folder - that's it right =) - TheSN

0