List of usage examples for org.springframework.integration.file.dsl Files splitter
public static FileSplitterSpec splitter(boolean iterator, boolean markers)
From source file:org.springframework.integration.samples.filesplit.Application.java
/** * Poll for files, add an error channel, split into lines route the start/end markers * to {@link #markers()} and the lines to {@link #lines}. * * @return the flow./*w ww. j a v a 2 s . c o m*/ */ @Bean public IntegrationFlow fromFile() { return IntegrationFlows .from(Files.inboundAdapter(new File("/tmp/in")).preventDuplicates(false).patternFilter("*.txt"), e -> e.poller(Pollers.fixedDelay(5000).errorChannel("tfrErrors.input")) .id("fileInboundChannelAdapter")) .handle(Files.splitter(true, true)) .<Object, Class<?>>route(Object::getClass, m -> m.channelMapping(FileSplitter.FileMarker.class, "markers.input") .channelMapping(String.class, "lines.input")) .get(); }