boolean (File file) { String filePath = FileUtilRt.toSystemIndependentName(file.getPath()); int patternIndex = FIND_SNIPPETS_FOLDER_PATTERN.apply(filePath, 0); if (patternIndex < 0) { return false; } // ensure the file is under the root String rootPath = FileUtilRt.toSystemIndependentName(myRoot.getPath()); if (!FileUtil.startsWith(filePath, rootPath, SystemInfoRt.isFileSystemCaseSensitive, true)) { return false; } int fromIndex = rootPath.endsWith("/")? rootPath.length() - 1 : rootPath.length(); return patternIndex >= fromIndex || FIND_SNIPPETS_FOLDER_PATTERN.apply(filePath, fromIndex) >= 0; }