INT-1482 charset value is now being set for bothFtpSendingMessageHandler and SftpSendingMessageHandler
This commit is contained in:
@@ -71,9 +71,10 @@ public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean<Ftp
|
||||
defaultFtpClientFactory);
|
||||
|
||||
FtpSendingMessageHandler ftpSendingMessageHandler = new FtpSendingMessageHandler(queuedFtpClientPool);
|
||||
ftpSendingMessageHandler.setCharset( this.charset);
|
||||
if (this.charset != null) {
|
||||
ftpSendingMessageHandler.setCharset(this.charset);
|
||||
}
|
||||
ftpSendingMessageHandler.afterPropertiesSet();
|
||||
|
||||
return ftpSendingMessageHandler;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ public class SftpMessageSendingConsumerFactoryBean implements FactoryBean<SftpSe
|
||||
private String username;
|
||||
private boolean autoCreateDirectories;
|
||||
private int port;
|
||||
private String charset;
|
||||
|
||||
public SftpSendingMessageHandler getObject() throws Exception {
|
||||
SftpSessionFactory sessionFactory = SftpSessionUtils.buildSftpSessionFactory(
|
||||
@@ -46,6 +47,7 @@ public class SftpMessageSendingConsumerFactoryBean implements FactoryBean<SftpSe
|
||||
|
||||
SftpSendingMessageHandler sftpSendingMessageHandler = new SftpSendingMessageHandler(queuedSFTPSessionPool);
|
||||
sftpSendingMessageHandler.setRemoteDirectory(this.remoteDirectory);
|
||||
sftpSendingMessageHandler.setCharset(this.charset);
|
||||
sftpSendingMessageHandler.afterPropertiesSet();
|
||||
|
||||
return sftpSendingMessageHandler;
|
||||
@@ -63,6 +65,10 @@ public class SftpMessageSendingConsumerFactoryBean implements FactoryBean<SftpSe
|
||||
this.autoCreateDirectories = autoCreateDirectories;
|
||||
}
|
||||
|
||||
public void setCharset(String charset) {
|
||||
this.charset = charset;
|
||||
}
|
||||
|
||||
public void setHost(final String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SftpNamespaceHandler extends NamespaceHandlerSupport {
|
||||
protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) {
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(SftpMessageSendingConsumerFactoryBean.class.getName());
|
||||
|
||||
for (String p : "auto-create-directories,username,password,host,key-file,key-file-password,remote-directory".split(",")) {
|
||||
for (String p : "auto-create-directories,username,password,host,port,key-file,key-file-password,remote-directory,charset".split(",")) {
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, p);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
|
||||
<xsd:attribute name="username" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="remote-directory" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="host" type="xsd:string" use="required"/>
|
||||
@@ -60,6 +59,7 @@
|
||||
<xsd:attribute name="key-file" type="xsd:string"/>
|
||||
<xsd:attribute name="key-file-password" type="xsd:string"/>
|
||||
|
||||
<xsd:attribute name="charset" type="xsd:string"/>
|
||||
<xsd:attribute name="auto-create-directories" type="xsd:boolean"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
Reference in New Issue
Block a user