INT-1921 fixed FTP/SFTP adapters to have '/' as a default file separator character

This commit is contained in:
Oleg Zhurakousky
2011-05-31 15:16:56 -04:00
parent 350e4f34fb
commit 97db1da5b2
5 changed files with 11 additions and 8 deletions

View File

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

View File

@@ -37,7 +37,7 @@
</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

@@ -30,7 +30,7 @@
<constructor-arg value="java.util.Comparator"/>
</bean>
<int-ftp:inbound-channel-adapter
<int-ftp:inbound-channel-adapter
channel="ftpChannel"
session-factory="ftpSessionFactory"
charset="UTF-8"

View File

@@ -80,6 +80,11 @@ public class FtpInboundChannelAdapterParserTests {
SourcePollingChannelAdapter adapter = ac.getBean("simpleAdapter", SourcePollingChannelAdapter.class);
Object sessionFactory = TestUtils.getPropertyValue(adapter, "source.synchronizer.sessionFactory");
assertEquals(CachingSessionFactory.class, sessionFactory.getClass());
FtpInboundFileSynchronizer fisync =
TestUtils.getPropertyValue(adapter, "source.synchronizer", FtpInboundFileSynchronizer.class);
String remoteFileSeparator = (String) TestUtils.getPropertyValue(fisync, "remoteFileSeparator");
assertNotNull(remoteFileSeparator);
assertEquals("/", remoteFileSeparator);
}
@Test
@@ -89,7 +94,7 @@ public class FtpInboundChannelAdapterParserTests {
Map<String, SourcePollingChannelAdapter> spcas = ac.getBeansOfType(SourcePollingChannelAdapter.class);
SourcePollingChannelAdapter adapter = null;
for (String key : spcas.keySet()) {
if (!key.equals("ftpInbound")){
if (!key.equals("ftpInbound") && !key.equals("simpleAdapter")){
adapter = spcas.get(key);
}
}

View File

@@ -62,7 +62,7 @@
</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: '/'
@@ -230,7 +230,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: '/'