BinnedFileFilter extends BeamFileFilter { @Override public boolean accept(File file) { if (file.isDirectory()) { return true; } if (super.accept(file)) { return isBinnedName(file.getName()); } return false; } BinnedFileFilter(); @Override boolean accept(File file); static boolean isBinnedName(String name);  }
@Test public void testAccept() { final File tempDir = new File(System.getProperty("java.io.tmpdir")); assertTrue(tempDir.isDirectory()); assertTrue(filter.accept(tempDir)); assertTrue(filter.accept(new File("ESACCI-OC-L3S-OC_PRODUCTS-MERGED-1M_MONTHLY_4km_PML_TEST_COMPOSITE_200306.nc"))); assertFalse(filter.accept(new File("ESACCI-OC-L3S-OC_PRODUCTS-MERGED-1M_MONTHLY_4km_PML_TEST_COMPOSITE_200306"))); assertFalse(filter.accept(new File("MER_FR__1PNUPA20070708_164713_000000982059_00384_27993_4986.N1"))); assertFalse(filter.accept(new File("MER_FR__1PNUPA20070708_164713_000000982059_00384_27993_4986.nc"))); }