void (@NotNull File directory) { final ComponentManagerSettings rootManagerSettings = context.getProjectRootManagerSettings(); if (rootManagerSettings != null) { final Element projectRootManager = rootManagerSettings.getComponentElement("ProjectRootManager"); if (projectRootManager != null) { final Element outputElement = projectRootManager.getChild("output"); if (outputElement != null) { final String outputUrl = outputElement.getAttributeValue("url"); if (outputUrl != null) { final File outputFile = getFile(outputUrl); if (FileUtil.isAncestor(outputFile, directory, false)) { return; } } } } } for (Element contentRoot : getContentRootElements()) { final File root = getFile(contentRoot.getAttributeValue(JpsModuleRootModelSerializer.URL_ATTRIBUTE)); if (FileUtil.isAncestor(root, directory, true)) { addExcludedFolder(directory, contentRoot); } } }