@Test public void acceptPathShouldProperlyAcceptPathsWhereTheNonLastComponentStartsWithADot() throws Exception { PathFilter filter = new NotificationEventPathFilter(Pattern.compile(".*"), true); assertTrue(filter.accept(new Path("/some/long/path/.some_hidden_file/should/work"))); assertTrue(filter.accept(new Path("/.some_hidden_file/should/still/accept"))); }
@Override public boolean accept(Path path) { return !(path == null || (toIgnoreHiddenFiles && path.getName().startsWith("."))) && watchDirectory.matcher(path.toString()).matches(); }
NotificationEventPathFilter implements PathFilter { @Override public boolean accept(Path path) { return !(path == null || (toIgnoreHiddenFiles && path.getName().startsWith("."))) && watchDirectory.matcher(path.toString()).matches(); } }
NotificationEventPathFilter implements PathFilter { @Override public boolean accept(Path path) { return !(path == null || (toIgnoreHiddenFiles && path.getName().startsWith("."))) && watchDirectory.matcher(path.toString()).matches(); } NotificationEventPathFilter(Pattern watchDirectory, boolean toIgnoreHiddenFiles); }
NotificationEventPathFilter implements PathFilter { @Override public boolean accept(Path path) { return !(path == null || (toIgnoreHiddenFiles && path.getName().startsWith("."))) && watchDirectory.matcher(path.toString()).matches(); } NotificationEventPathFilter(Pattern watchDirectory, boolean toIgnoreHiddenFiles); @Override boolean accept(Path path); }
NotificationEventPathFilter implements PathFilter { @Override public boolean accept(Path path) { return !(path == null || (toIgnoreHiddenFiles && path.getName().startsWith("."))) && watchDirectory.matcher(path.toString()).matches(); } NotificationEventPathFilter(Pattern watchDirectory, boolean toIgnoreHiddenFiles); @Override boolean accept(Path path);  }