FileFilter { public boolean isAllowedAndUnderContentRoot(VirtualFile f) { return isAllowed(f) && isUnderContentRoot(f); } FileFilter(FileIndex fi, FileTypeManager tm); boolean isAllowedAndUnderContentRoot(VirtualFile f); boolean isUnderContentRoot(VirtualFile f); boolean isAllowed(VirtualFile f); static final long MAX_FILE_SIZE; }
@Test public void testIsAllowedAndUnderContentRoot() { final boolean[] values = new boolean[2]; FileFilter f = new FileFilter(null, null) { @Override public boolean isUnderContentRoot(VirtualFile f) { return values[0]; } @Override public boolean isAllowed(VirtualFile f) { return values[1]; } }; values[0] = true; values[1] = true; assertTrue(f.isAllowedAndUnderContentRoot(null)); values[0] = false; values[1] = true; assertFalse(f.isAllowedAndUnderContentRoot(null)); values[0] = true; values[1] = false; assertFalse(f.isAllowedAndUnderContentRoot(null)); }