INT-1885 added support for empty remote-file-separator to the FTP Inbound Channel Adapter
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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: '/'
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user