Source:
<code><START> public IntegrationFlow sftpInboundFlow() { <END> SftpInboundChannelAdapterSpec messageSourceBuilder = Sftp.inboundAdapter(this.sftpSessionFactory) .preserveTimestamp(this.properties.isPreserveTimestamp()) .remoteDirectory(this.properties.getRemoteDir()) .remoteFileSeparator(this.properties.getRemoteFileSeparator()) .localDirectory(this.properties.getLocalDir()) .autoCreateLocalDirectory(this.properties.isAutoCreateLocalDir()) .temporaryFileSuffix(this.properties.getTmpFileSuffix()) .deleteRemoteFiles(this.properties.isDeleteRemoteFiles()); if (StringUtils.hasText(this.properties.getFilenamePattern())) { messageSourceBuilder.filter(new SftpSimplePatternFileListFilter(this.properties.getFilenamePattern())); } else if (StringUtils.hasText(this.properties.getFilenameRegex())) { messageSourceBuilder .filter(new SftpRegexPatternFileListFilter(Pattern.compile(this.properties.getFilenameRegex()))); } IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(messageSourceBuilder , new Consumer<SourcePollingChannelAdapterSpec>() { @Override public void accept(SourcePollingChannelAdapterSpec sourcePollingChannelAdapterSpec) { sourcePollingChannelAdapterSpec .autoStartup(false) .poller(poller()); } }); switch (this.fileConsumerProperties.getMode()) { case contents: flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE, "application/octet-stream")) .transform(new FileToByteArrayTransformer()); break; case lines: flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE, "text/plain")) .split(new FileSplitter(true, this.fileConsumerProperties.getWithMarkers()), null); case ref: break; default: throw new IllegalArgumentException(fileConsumerProperties.getMode().name() + " is not a supported file reading mode."); } return flowBuilder.channel(this.source.output()).get(); }</code><technical_language>familiar enough SI DSL. this context work? IntegrationFlow beans handled in some way? I SI annotation here</technical_language>

Target:
public IntegrationFlow sftpInboundFlow() { SftpInboundChannelAdapterSpec messageSourceBuilder = Sftp.inboundAdapter(this.sftpSessionFactory) .preserveTimestamp(this.properties.isPreserveTimestamp()) .remoteDirectory(this.properties.getRemoteDir()) .remoteFileSeparator(this.properties.getRemoteFileSeparator()) .localDirectory(this.properties.getLocalDir()) .autoCreateLocalDirectory(this.properties.isAutoCreateLocalDir()) .temporaryFileSuffix(this.properties.getTmpFileSuffix()) .deleteRemoteFiles(this.properties.isDeleteRemoteFiles()); if (StringUtils.hasText(this.properties.getFilenamePattern())) { messageSourceBuilder.filter(new SftpSimplePatternFileListFilter(this.properties.getFilenamePattern())); } else if (this.properties.getFilenameRegex() != null) { messageSourceBuilder .filter(new SftpRegexPatternFileListFilter(this.properties.getFilenameRegex())); } IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(messageSourceBuilder , new Consumer<SourcePollingChannelAdapterSpec>() { @Override public void accept(SourcePollingChannelAdapterSpec sourcePollingChannelAdapterSpec) { sourcePollingChannelAdapterSpec .autoStartup(false) .poller(poller()); } }); switch (this.fileConsumerProperties.getMode()) { case contents: flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE, "application/octet-stream")) .transform(new FileToByteArrayTransformer()); break; case lines: flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE, "text/plain")) .split(new FileSplitter(true, this.fileConsumerProperties.getWithMarkers()), null); case ref: break; default: throw new IllegalArgumentException(fileConsumerProperties.getMode().name() + " is not a supported file reading mode."); } return flowBuilder.channel(this.source.output()).get(); }