/** * Test the layout of a directory against the sieve. * * @param dir the directory to test * @return true if the directory structure matches the sieve's configuration. */ public boolean matches(File dir) { for (String str : includes) { File f = new File(dir, Path.translateFile(str)); if (!f.exists()) return false; } for (String str : excludes) { File f = new File(dir, Path.translateFile(str)); if (f.exists()) return false; } return true; }