String (@NotNull FilePath filePath, boolean systemDependent, Set<VirtualFile> roots) { VirtualFile commonAncestor = VfsUtil.getCommonAncestor(roots); String path = null; if (commonAncestor != null) { path = FileUtil.getRelativePath(commonAncestor.getPath(), filePath.getPath(), '/'); if (path != null && systemDependent) path = FileUtil.toSystemDependentName(path); } if (path == null) path = systemDependent ? filePath.getPresentableUrl() : filePath.getPath(); char separator = separator(systemDependent); return path + (filePath.isDirectory() && !StringUtil.endsWithChar(path, separator) ? separator : ""); }