diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParser.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParser.java index bcaa3b1937..b93fa25f3c 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParser.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParser.java @@ -16,42 +16,19 @@ package org.springframework.integration.ftp.config; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import org.w3c.dom.Element; - -import org.springframework.beans.BeanMetadataElement; -import org.springframework.beans.factory.config.RuntimeBeanReference; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.support.BeanDefinitionReaderUtils; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.config.xml.AbstractPollingInboundChannelAdapterParser; -import org.springframework.integration.config.xml.IntegrationNamespaceUtils; /** * Parser for the FTP inbound-channel-adapter. * * @author Josh Long + * @author Oleg Zhurakousky + * @since 2.0 */ -public class FtpInboundChannelAdapterParser extends AbstractPollingInboundChannelAdapterParser { - - private Set receiveAttrs = new HashSet(Arrays.asList( - "auto-delete-remote-files-on-sync,filename-pattern,local-working-directory".split(","))); +public class FtpInboundChannelAdapterParser extends AbstractFtpInboundChannelAdapterParser { @Override - protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) { - BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition( - FtpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean.class.getName()); - IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "filter"); - for (String a : receiveAttrs) { - IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, a); - } - FtpNamespaceParserSupport.configureCoreFtpClient(builder, element, parserContext); - String beanName = BeanDefinitionReaderUtils.registerWithGeneratedName( - builder.getBeanDefinition(), parserContext.getRegistry()); - return new RuntimeBeanReference(beanName); + protected String getClassName() { + return "org.springframework.integration.ftp.config.FtpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean"; } } diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpsInboundChannelAdapterParser.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpsInboundChannelAdapterParser.java index 82a11d7f93..e7edd79797 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpsInboundChannelAdapterParser.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/config/FtpsInboundChannelAdapterParser.java @@ -16,38 +16,18 @@ package org.springframework.integration.ftp.config; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import org.w3c.dom.Element; - -import org.springframework.beans.BeanMetadataElement; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.config.xml.AbstractPollingInboundChannelAdapterParser; -import org.springframework.integration.config.xml.IntegrationNamespaceUtils; /** * Parser for the FTPS inbound-channel-adapter * * @author Josh Long + * @author Oleg Zhurakousky + * @since 2.0 */ -public class FtpsInboundChannelAdapterParser extends AbstractPollingInboundChannelAdapterParser { - - private Set receiveAttrs = new HashSet(Arrays.asList( - "auto-delete-remote-files-on-sync,filename-pattern,local-working-directory".split(","))); +public class FtpsInboundChannelAdapterParser extends AbstractFtpInboundChannelAdapterParser { @Override - protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) { - BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition( - FtpsInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean.class.getName()); - IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "filter"); - for (String a : receiveAttrs) { - IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, a); - } - FtpNamespaceParserSupport.configureCoreFtpClient(builder, element, parserContext); - return builder.getBeanDefinition(); + protected String getClassName() { + return "org.springframework.integration.ftp.config.FtpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean"; } - }