String (final @NotNull List<String> currentRoots, final @NotNull String rootPath, final @Nullable String relativeToRootPath) { for (String currentRoot : currentRoots) { if (currentRoot.endsWith(rootPath) || Comparing.strEqual(rootPath, EclipseProjectFinder.findProjectName(currentRoot))) { //rootPath = content_root <=> applicable root: abs_path/content_root if (relativeToRootPath == null) { return pathToUrl(currentRoot); } final File relativeToOtherModuleFile = new File(currentRoot, relativeToRootPath); if (relativeToOtherModuleFile.exists()) { return pathToUrl(relativeToOtherModuleFile.getPath()); } } } return null; }