You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#8713
* Introduce `DefaultSftpSessionFactory.createSftpClient()` factory method
which can be overridden for any custom `SftpClient` use-case
* Add changes to the docs
* Some code clean up
**Cherry-pick to `6.1.x`**
Copy file name to clipboardExpand all lines: spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java
+27-7Lines changed: 27 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,10 @@
53
53
54
54
/**
55
55
* Factory for creating {@link SftpSession} instances.
56
+
* <p>
57
+
* The {@link #createSftpClient(ClientSession, SftpVersionSelector, SftpErrorDataHandler)}
58
+
* can be overridden to provide a custom {@link SftpClient}.
59
+
* The {@link ConcurrentSftpClient} is used by default.
56
60
*
57
61
* @author Josh Long
58
62
* @author Mario Gray
@@ -65,6 +69,7 @@
65
69
* @author Krzysztof Debski
66
70
* @author Auke Zaaiman
67
71
* @author Christian Tzolov
72
+
* @author Adama Sorho
68
73
*
69
74
* @since 2.0
70
75
*/
@@ -282,9 +287,7 @@ public SftpSession getSession() {
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/sftp/session-factory.adoc
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,26 @@ When using this feature, you must wrap the session factory in a caching session
38
38
39
39
If the cache is reset, the session is disconnected only when the last channel is closed.
40
40
41
-
The connection is refreshed if it is found to be disconnected when a new operation obtains a session.
41
+
The connection is refreshed if it to be disconnected when a new operation obtains a session.
42
42
=====
43
43
44
44
Now all you need to do is inject this SFTP session factory into your adapters.
45
45
46
46
NOTE: A more practical way to provide values for the SFTP session factory is to use Spring's https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-factory-placeholderconfigurer[property placeholder support].
47
47
48
+
Starting with version 6.1.3, the `DefaultSftpSessionFactory` introduces a `createSftpClient(...)` to support a custom `SftpClient`.
49
+
See a sample below of how to override `createSftpChannelSubsystem()` method in your custom `SftpClient` to add, for example, some custom `RequestHandler` for SFTP sub-system requests and replies:
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/whats-new.adoc
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -72,3 +72,9 @@ See xref:mongodb.adoc#mongodb-message-store[MongoDB Message Store] for an exampl
72
72
73
73
`FtpLastModifiedFileListFilter`, `SftpLastModifiedFileListFilter` and `SmbLastModifiedFileListFilter` have been introduced to allow files filtering based on a last-modified strategy respectively for `FTP`, `SFTP` and `SMB`.
74
74
See xref:ftp/inbound.adoc#ftp-inbound[FTP Inbound Channel Adapter], xref:sftp/inbound.adoc#sftp-inbound[SFTP Inbound Channel Adapter], and xref:smb.adoc#smb-inbound[SMB Inbound Channel Adapter] for more information.
75
+
76
+
[[x6.2-sftp-changes]]
77
+
=== SFTP Support Changes
78
+
79
+
A new `DefaultSftpSessionFactory.createSftpClient(...)` method has been introduced to support a custom `SftpClient` when overridden.
80
+
See xref:sftp/session-factory.adoc#sftp-session-factory[SFTP Session Factory] for more information.
0 commit comments