fixing issues related to fileType not propagating in the ftp handler

This commit is contained in:
Josh Long
2010-09-12 13:06:01 -07:00
parent 86fafd0002
commit 6c959e6010
5 changed files with 15 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -14,6 +14,9 @@ public class FtpsSendingMessageHandlerFactoryBean extends FtpSendingMessageHandl
*/
protected volatile String protocol;
/**
* "P"
*/

View File

@@ -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"

View File

@@ -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"