JIRA: https://jira.spring.io/browse/INT-4495 Previously, `maxFetch` was applied before directories were removed from the fetch list. Remove the directories before filtering and applying `maxFetch`. * Polishing - PR Comments * More polishing * More polishing. * Check for empty array. * Remove test main method. INT-4495: Fix SFTP tests