ContentEntry (@NotNull String moduleName, @NotNull String contentPath) { ModuleRootManager moduleRootManager = getRootManager(moduleName); Module module = moduleRootManager.getModule(); String rootPath = getAbsolutePath(ExternalSystemApiUtil.getExternalProjectPath(module)); String expectedContentPath = getAbsolutePath(rootPath + "/" + contentPath); ContentEntry[] contentEntries = moduleRootManager.getContentEntries(); for (ContentEntry contentEntry : contentEntries) { String actualContentPath = getAbsolutePath(contentEntry.getUrl()); if (actualContentPath.equals(expectedContentPath)) return contentEntry; } return null; }