コード例 #1
0
 @Override
 public boolean filterRecord(Record record) {
   FileRecord fileRecord = (FileRecord) record;
   for (String extension : extensions) {
     if (fileRecord.getPayload().getName().endsWith(extension)) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
 @Before
 public void setUp() throws Exception {
   filter = new FileExtensionFilter(".txt", ".xml");
   when(fileRecord.getPayload()).thenReturn(file);
 }