public PathFilteringService(Path ignoreRulesFilePath) throws IOException { if (Files.exists(ignoreRulesFilePath)) { FileSystem fs = FileSystems.getDefault(); this.ignoreFilesRules = new ArrayList<PathMatcher>(); List<String> lines = Files.readAllLines(ignoreRulesFilePath, Charset.defaultCharset()); for (String line : lines) { this.ignoreFilesRules.add(fs.getPathMatcher("glob:" + line)); } } }