@Override
	public Map<String, ExecutionContext> partition(int gridSize) {
		Map<String, ExecutionContext> partitions = new HashMap<String, ExecutionContext>();
		String[] filesToFetch = gateway.filesToFetch(this.remoteDirectory);
		for (String fileName : filesToFetch) {
			ExecutionContext context = new ExecutionContext();
			context.putString("filePath", remoteDirectory + fileName.trim());
			partitions.put(fileName.trim(), context);
		}
		return partitions;
	}
Takes the result of an (S)FTP Gateway LS (list of FileInfo) and creates a {@link StepExecution} for each file.

Invokes the gateway flow via {@link Gateway}.

@author Gary Russell
extensions/spring-xd-extension-batch/src/main/java/org/springframework/batch/integration/x/RemoteFilePartitioner.java