@Test public void testPerformListing() throws Exception { runner.setProperty(ListFile.DIRECTORY, testDir.getAbsolutePath()); runNext(); runner.assertTransferCount(ListFile.REL_SUCCESS, 0); final File file1 = new File(TESTDIR + "/listing1.txt"); assertTrue(file1.createNewFile()); assertTrue(file1.setLastModified(time4millis)); runNext(); runner.assertAllFlowFilesTransferred(ListFile.REL_SUCCESS); final List<MockFlowFile> successFiles1 = runner.getFlowFilesForRelationship(ListFile.REL_SUCCESS); assertEquals(1, successFiles1.size()); final File file2 = new File(TESTDIR + "/listing2.txt"); assertTrue(file2.createNewFile()); assertTrue(file2.setLastModified(time2millis)); runNext(); runner.assertAllFlowFilesTransferred(ListFile.REL_SUCCESS); final List<MockFlowFile> successFiles2 = runner.getFlowFilesForRelationship(ListFile.REL_SUCCESS); assertEquals(1, successFiles2.size()); final File file3 = new File(TESTDIR + "/listing3.txt"); assertTrue(file3.createNewFile()); assertTrue(file3.setLastModified(time4millis)); runNext(); runner.assertAllFlowFilesTransferred(ListFile.REL_SUCCESS); final List<MockFlowFile> successFiles3 = runner.getFlowFilesForRelationship(ListFile.REL_SUCCESS); assertEquals(0, successFiles3.size()); runner.removeProperty(ListFile.DIRECTORY); runner.setProperty(ListFile.DIRECTORY, testDir.getAbsolutePath()); runNext(); runner.assertAllFlowFilesTransferred(ListFile.REL_SUCCESS); final List<MockFlowFile> successFiles4 = runner.getFlowFilesForRelationship(ListFile.REL_SUCCESS); assertEquals(3, successFiles4.size()); runNext(); runner.assertTransferCount(ListFile.REL_SUCCESS, 0); }
@Override protected List<FileInfo> performListing(final ProcessContext context, final Long minTimestamp) throws IOException { final File path = new File(getPath(context)); final Boolean recurse = context.getProperty(RECURSE).asBoolean(); return scanDirectory(path, fileFilterRef.get(), recurse, minTimestamp); }
ListFile extends AbstractListProcessor<FileInfo> { @Override protected List<FileInfo> performListing(final ProcessContext context, final Long minTimestamp) throws IOException { final File path = new File(getPath(context)); final Boolean recurse = context.getProperty(RECURSE).asBoolean(); return scanDirectory(path, fileFilterRef.get(), recurse, minTimestamp); } }
ListFile extends AbstractListProcessor<FileInfo> { @Override protected List<FileInfo> performListing(final ProcessContext context, final Long minTimestamp) throws IOException { final File path = new File(getPath(context)); final Boolean recurse = context.getProperty(RECURSE).asBoolean(); return scanDirectory(path, fileFilterRef.get(), recurse, minTimestamp); }  }
ListFile extends AbstractListProcessor<FileInfo> { @Override protected List<FileInfo> performListing(final ProcessContext context, final Long minTimestamp) throws IOException { final File path = new File(getPath(context)); final Boolean recurse = context.getProperty(RECURSE).asBoolean(); return scanDirectory(path, fileFilterRef.get(), recurse, minTimestamp); }  @Override Set<Relationship> getRelationships(); @OnScheduled void onScheduled(final ProcessContext context); }
ListFile extends AbstractListProcessor<FileInfo> { @Override protected List<FileInfo> performListing(final ProcessContext context, final Long minTimestamp) throws IOException { final File path = new File(getPath(context)); final Boolean recurse = context.getProperty(RECURSE).asBoolean(); return scanDirectory(path, fileFilterRef.get(), recurse, minTimestamp); }  @Override Set<Relationship> getRelationships(); @OnScheduled void onScheduled(final ProcessContext context); static final PropertyDescriptor DIRECTORY; static final PropertyDescriptor RECURSE; static final PropertyDescriptor DIRECTORY_LOCATION; static final PropertyDescriptor FILE_FILTER; static final PropertyDescriptor PATH_FILTER; static final PropertyDescriptor MIN_AGE; static final PropertyDescriptor MAX_AGE; static final PropertyDescriptor MIN_SIZE; static final PropertyDescriptor MAX_SIZE; static final PropertyDescriptor IGNORE_HIDDEN_FILES; static final String FILE_CREATION_TIME_ATTRIBUTE; static final String FILE_LAST_MODIFY_TIME_ATTRIBUTE; static final String FILE_LAST_ACCESS_TIME_ATTRIBUTE; static final String FILE_SIZE_ATTRIBUTE; static final String FILE_OWNER_ATTRIBUTE; static final String FILE_GROUP_ATTRIBUTE; static final String FILE_PERMISSIONS_ATTRIBUTE; static final String FILE_MODIFY_DATE_ATTR_FORMAT; }