fixing issues related to fileType not propagating in the ftp handler
This commit is contained in:
@@ -71,7 +71,7 @@ public class ClientFactorySupport {
|
||||
return defaultFtpClientFactory;
|
||||
}
|
||||
|
||||
public static DefaultFtpClientFactory ftpClientFactory(String host, int port, String remoteDir, String user, String pw, int clientMode) {
|
||||
public static DefaultFtpClientFactory ftpClientFactory(String host, int port, String remoteDir, String user, String pw, int clientMode, int fileType) {
|
||||
DefaultFtpClientFactory defaultFtpClientFactory = new DefaultFtpClientFactory();
|
||||
defaultFtpClientFactory.setHost(host);
|
||||
defaultFtpClientFactory.setPassword(pw);
|
||||
@@ -79,6 +79,7 @@ public class ClientFactorySupport {
|
||||
defaultFtpClientFactory.setRemoteWorkingDirectory(remoteDir);
|
||||
defaultFtpClientFactory.setUsername(user);
|
||||
defaultFtpClientFactory.setClientMode(clientMode);
|
||||
defaultFtpClientFactory.setFileType( fileType );
|
||||
|
||||
return defaultFtpClientFactory;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,12 @@ public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean<Ftp
|
||||
protected String remoteDirectory;
|
||||
protected int clientMode;
|
||||
|
||||
public void setFileType(int fileType) {
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
private int fileType ;
|
||||
|
||||
// private vars
|
||||
private ResourceLoader resourceLoader;
|
||||
private ApplicationContext applicationContext;
|
||||
@@ -46,7 +52,7 @@ public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean<Ftp
|
||||
}
|
||||
|
||||
protected AbstractFtpClientFactory clientFactory() {
|
||||
return ClientFactorySupport.ftpClientFactory( this.host, this.port , this.remoteDirectory , this.username , this.password , this.clientMode );
|
||||
return ClientFactorySupport.ftpClientFactory( this.host, this.port , this.remoteDirectory , this.username , this.password , this.clientMode, this.fileType );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,6 +65,7 @@ public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean<Ftp
|
||||
QueuedFtpClientPool queuedFtpClientPool = new QueuedFtpClientPool(15, defaultFtpClientFactory);
|
||||
|
||||
FtpSendingMessageHandler ftpSendingMessageHandler = new FtpSendingMessageHandler(queuedFtpClientPool);
|
||||
|
||||
ftpSendingMessageHandler.afterPropertiesSet();
|
||||
|
||||
return ftpSendingMessageHandler;
|
||||
|
||||
@@ -14,6 +14,9 @@ public class FtpsSendingMessageHandlerFactoryBean extends FtpSendingMessageHandl
|
||||
*/
|
||||
protected volatile String protocol;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* "P"
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
remote-directory="${ftp.remotedir}"
|
||||
channel="ftpOutbound"
|
||||
host="${ftp.host}"
|
||||
file-type="binary-file-type"
|
||||
username="${ftp.username}"
|
||||
password="${ftp.password}" port="2222"
|
||||
client-mode="passive-local-data-connection-mode"
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<ftps:outbound-channel-adapter
|
||||
remote-directory="${ftp.remotedir}"
|
||||
channel="ftpOutbound"
|
||||
file-type="binary-file-type"
|
||||
host="${ftp.host}"
|
||||
username="${ftp.username}"
|
||||
password="${ftp.password}" port="21"
|
||||
|
||||
Reference in New Issue
Block a user