INT-1885 added support for empty remote-file-separator to the FTP Inbound Channel Adapter

This commit is contained in:
Oleg Zhurakousky
2011-05-05 18:45:03 -04:00
parent fa89de297e
commit 1731bfb3b4
5 changed files with 8 additions and 5 deletions

View File

@@ -54,7 +54,10 @@ public abstract class AbstractRemoteFileInboundChannelAdapterParser extends Abst
// configure the InboundFileSynchronizer properties
IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "remote-directory");
IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "delete-remote-files");
IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "remote-file-separator");
String remoteFileSeparator = element.getAttribute("remote-file-separator");
if (remoteFileSeparator != null){
synchronizerBuilder.addPropertyValue("remoteFileSeparator", remoteFileSeparator);
}
IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "temporary-file-suffix");
this.configureFilter(synchronizerBuilder, element, parserContext);

View File

@@ -90,7 +90,7 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
public void setRemoteFileSeparator(String remoteFileSeparator) {
Assert.hasText(remoteFileSeparator, "'remoteFileSeparator' must not be empty");
Assert.notNull(remoteFileSeparator, "'remoteFileSeparator' must not be null");
this.remoteFileSeparator = remoteFileSeparator;
}

View File

@@ -143,7 +143,7 @@ endpoint itself is a Polling Consumer for a channel with a queue.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="remote-file-separator" type="xsd:string">
<xsd:attribute name="remote-file-separator" type="xsd:string" default="/">
<xsd:annotation>
<xsd:documentation>
Allows you to provide remote file/directory separator character. DEFAULT: '/'

View File

@@ -19,7 +19,7 @@
delete-remote-files="true"
filename-pattern="*.txt"
local-directory="."
remote-file-separator="."
remote-file-separator=""
temporary-file-suffix=".foo"
remote-directory="foo/bar">
<int:poller fixed-rate="1000"/>

View File

@@ -61,7 +61,7 @@ public class FtpInboundChannelAdapterParserTests {
assertEquals(".foo", fisync.getTemporaryFileSuffix());
String remoteFileSeparator = (String) TestUtils.getPropertyValue(fisync, "remoteFileSeparator");
assertNotNull(remoteFileSeparator);
assertEquals(".", remoteFileSeparator);
assertEquals("", remoteFileSeparator);
FtpSimplePatternFileListFilter filter = (FtpSimplePatternFileListFilter) TestUtils.getPropertyValue(fisync, "filter");
assertNotNull(filter);
Object sessionFactory = TestUtils.getPropertyValue(fisync, "sessionFactory");