@Test public void acceptPathShouldProperlyMatchAllSubdirectoriesThatMatchWatchDirectoryAndFileFilter() throws Exception { PathFilter filter = new NotificationEventPathFilter(Pattern.compile("/root(/.*)?"), true); assertTrue(filter.accept(new Path("/root/sometest.txt"))); }
@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);  }