String (final VirtualFile virtualFile, final ProjectFileIndex index) { List<String> path = new ArrayList<>(); VirtualFile directory = virtualFile; while (directory != null && index.isInLibrary(directory)) { path.add(directory.getName()); directory = directory.getParent(); } if (path.isEmpty()) return ""; Collections.reverse(path); return StringUtil.join(ArrayUtilRt.toStringArray(path), 1, path.size(), "/"); }