SourceFolder (@NotNull ContentEntry contentEntry, @NotNull SourceRoot sourceRoot) { for (SourceFolder folder : contentEntry.getSourceFolders()) { VirtualFile file = folder.getFile(); if (file == null) continue; String folderPath = ExternalSystemApiUtil.getLocalFileSystemPath(file); String rootPath = sourceRoot.getPath(); if (folderPath.equals(rootPath)) return folder; } return null; }