http://jira.mfd.msk:8088/browse/CLS-790 sftp folder path trailing slash bug fixed
This commit is contained in:
parent
939c545365
commit
e3099abb42
1 changed files with 12 additions and 2 deletions
|
|
@ -100,8 +100,13 @@ public class SFTPConfig {
|
|||
@ServiceActivator(inputChannel = "listSftpChannelSdf")
|
||||
public MessageHandler handlerListSdf(@Qualifier("sftpSessionFactorySdf") SessionFactory<ChannelSftp.LsEntry> sessionFactory,
|
||||
ImportXMLServiceSettings settings) {
|
||||
String localDirLocation = settings.getStore().getSrcDir();
|
||||
if (!List.of("/", "\\").contains(localDirLocation.substring(localDirLocation.length() - 1))) {
|
||||
localDirLocation += File.separator;
|
||||
}
|
||||
|
||||
SftpOutboundGateway sftpOutboundGateway = new SftpOutboundGateway(sessionFactory, MGET.getCommand(), null);
|
||||
sftpOutboundGateway.setLocalDirectory(new File(settings.getStore().getSrcDir()));
|
||||
sftpOutboundGateway.setLocalDirectory(new File(localDirLocation));
|
||||
sftpOutboundGateway.setAutoCreateLocalDirectory(true);
|
||||
sftpOutboundGateway.setOption(AbstractRemoteFileOutboundGateway.Option.DELETE);
|
||||
return sftpOutboundGateway;
|
||||
|
|
@ -112,8 +117,13 @@ public class SFTPConfig {
|
|||
@ServiceActivator(inputChannel = "listSftpChannelLks")
|
||||
public MessageHandler handlerListLks(@Qualifier("sftpSessionFactoryLks") SessionFactory<ChannelSftp.LsEntry> sessionFactory,
|
||||
ImportXMLServiceSettings settings) {
|
||||
String localDirLocation = settings.getStore().getSrcDir();
|
||||
if (!List.of("/", "\\").contains(localDirLocation.substring(localDirLocation.length() - 1))) {
|
||||
localDirLocation += File.separator;
|
||||
}
|
||||
|
||||
SftpOutboundGateway sftpOutboundGateway = new SftpOutboundGateway(sessionFactory, MGET.getCommand(), null);
|
||||
sftpOutboundGateway.setLocalDirectory(new File(settings.getStoreLks().getSrcDir()));
|
||||
sftpOutboundGateway.setLocalDirectory(new File(localDirLocation));
|
||||
sftpOutboundGateway.setAutoCreateLocalDirectory(true);
|
||||
sftpOutboundGateway.setOption(AbstractRemoteFileOutboundGateway.Option.DELETE);
|
||||
return sftpOutboundGateway;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue