/** * creates a batch job that fetches the latest file for a given pattern, moving older files to a * skipped directory. * * @param config configuration of downloader job. * @param client remote client operations <b>The caller is responsible to release resources after * the Job executes, if applicable.<b> * @param remoteConfiguration remote client storage configuration. * @param fileType type of file that one wants to download. * @return Batch Job that can be executed. */ public static BatchJob<SftpFilename, ControlFilePersistenceOutputInfo> makeOldFilesMovingLatestFileDownloaderJob( final CtlDownloaderJob.Configuration config, final RemoteClient client, final RemoteConfiguration remoteConfiguration, final FileType fileType) { return makeDownloaderJob( config, client, remoteConfiguration, new SftpOldFilesMovingLatestFileFetcher( client, remoteConfiguration.getSkippedFolder(), remoteConfiguration.getProcessingFolder(), remoteConfiguration.getIncomingFolder(), fileType)); }