ExcludeFolder (@NotNull Module module, @NotNull VirtualFile root) { for (ContentEntry entry : ModuleRootManager.getInstance(module).getContentEntries()) { for (ExcludeFolder folder : entry.getExcludeFolders()) { if (root.equals(folder.getFile())) { return folder; } } } return null; }