Class ResourcesItemReader

java.lang.Object
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.item.support.AbstractItemStreamItemReader<org.springframework.core.io.Resource>
org.springframework.batch.item.file.ResourcesItemReader
All Implemented Interfaces:
ItemReader<org.springframework.core.io.Resource>, ItemStream, ItemStreamReader<org.springframework.core.io.Resource>

public class ResourcesItemReader extends AbstractItemStreamItemReader<org.springframework.core.io.Resource>
ItemReader which produces Resource instances from an array. This can be used conveniently with a configuration entry that injects a pattern (e.g. mydir/*.txt, which can then be converted by Spring to an array of Resources by the ApplicationContext.

Thread-safe between calls to open(ExecutionContext). The ExecutionContext is not accurate in a multi-threaded environment, so do not rely on that data for restart (i.e. always open with a fresh context).
Since:
2.1
Author:
Dave Syer, Mahmoud Ben Hassine
See Also:
  • ResourceArrayPropertyEditor