|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <beans xmlns="http://www.springframework.org/schema/beans" |
3 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
4 | | - xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp" |
5 | | - xmlns:int="http://www.springframework.org/schema/integration" |
6 | | - xmlns:int-file="http://www.springframework.org/schema/integration/file" |
7 | | - xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | + xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp" |
| 5 | + xmlns:int="http://www.springframework.org/schema/integration" |
| 6 | + xmlns:int-file="http://www.springframework.org/schema/integration/file" |
| 7 | + xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd |
8 | 8 | http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd |
9 | 9 | http://www.springframework.org/schema/integration/file https://www.springframework.org/schema/integration/file/spring-integration-file.xsd |
10 | 10 | http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd"> |
11 | 11 |
|
12 | | - <bean id="extraConfig" class="org.springframework.integration.sftp.outbound.SftpServerOutboundTests$Config" /> |
| 12 | + <bean id="extraConfig" class="org.springframework.integration.sftp.outbound.SftpServerOutboundTests$Config"/> |
13 | 13 |
|
14 | 14 | <int:channel id="output"> |
15 | 15 | <int:queue/> |
|
18 | 18 | <int:channel id="inboundGet"/> |
19 | 19 |
|
20 | 20 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
21 | | - request-channel="inboundGet" |
22 | | - command="get" |
23 | | - command-options="-P" |
24 | | - expression="payload" |
25 | | - local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory.toUpperCase()" |
26 | | - local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
27 | | - reply-channel="output"/> |
| 21 | + request-channel="inboundGet" |
| 22 | + command="get" |
| 23 | + command-options="-P" |
| 24 | + expression="payload" |
| 25 | + local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory.toUpperCase()" |
| 26 | + local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
| 27 | + reply-channel="output"/> |
28 | 28 |
|
29 | 29 | <int:channel id="invalidDirExpression"/> |
30 | 30 |
|
31 | 31 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
32 | | - request-channel="invalidDirExpression" |
33 | | - command="get" |
34 | | - expression="payload" |
35 | | - local-directory-expression="T(java.io.File).separator + #remoteDirectory + '?:'" |
36 | | - reply-channel="output"/> |
| 32 | + request-channel="invalidDirExpression" |
| 33 | + command="get" |
| 34 | + expression="payload" |
| 35 | + local-directory-expression="T(java.io.File).separator + #remoteDirectory + '?:'" |
| 36 | + reply-channel="output"/> |
37 | 37 |
|
38 | 38 | <int:channel id="inboundMGet"/> |
39 | 39 |
|
40 | 40 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
41 | | - request-channel="inboundMGet" |
42 | | - command="mget" |
43 | | - command-options="-P" |
44 | | - expression="payload" |
45 | | - local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
46 | | - local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
47 | | - reply-channel="output"/> |
| 41 | + request-channel="inboundMGet" |
| 42 | + command="mget" |
| 43 | + command-options="-P" |
| 44 | + expression="payload" |
| 45 | + local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
| 46 | + local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
| 47 | + reply-channel="output"/> |
48 | 48 |
|
49 | 49 | <int:channel id="inboundMGetRecursive"/> |
50 | 50 |
|
51 | 51 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
52 | | - request-channel="inboundMGetRecursive" |
53 | | - command="mget" |
54 | | - expression="payload" |
55 | | - command-options="-R -P" |
56 | | - mode="REPLACE_IF_MODIFIED" |
57 | | - filter="dotStarDotTxtFilter" |
58 | | - local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
59 | | - local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
60 | | - reply-channel="output"/> |
| 52 | + request-channel="inboundMGetRecursive" |
| 53 | + command="mget" |
| 54 | + expression="payload" |
| 55 | + command-options="-R -P" |
| 56 | + mode="REPLACE_IF_MODIFIED" |
| 57 | + filter="dotStarDotTxtFilter" |
| 58 | + local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
| 59 | + local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
| 60 | + reply-channel="output"/> |
61 | 61 |
|
62 | 62 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
63 | | - request-channel="inboundLSRecursive" |
64 | | - command="ls" |
65 | | - expression="payload" |
66 | | - command-options="-R -dirs" |
67 | | - mode="REPLACE_IF_MODIFIED" |
68 | | - filter="dotStarDotTxtFilter" |
69 | | - local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
70 | | - local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
71 | | - reply-channel="output"/> |
| 63 | + request-channel="inboundLSRecursive" |
| 64 | + command="ls" |
| 65 | + expression="payload" |
| 66 | + command-options="-R -dirs" |
| 67 | + mode="REPLACE_IF_MODIFIED" |
| 68 | + filter="dotStarDotTxtFilter" |
| 69 | + local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
| 70 | + local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
| 71 | + reply-channel="output"/> |
72 | 72 |
|
73 | 73 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
74 | | - request-channel="inboundLSRecursiveALL" |
75 | | - command="ls" |
76 | | - expression="payload" |
77 | | - command-options="-a -R -dirs" |
78 | | - mode="REPLACE_IF_MODIFIED" |
79 | | - filter="dotStarDotTxtFilter" |
80 | | - local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
81 | | - local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
82 | | - reply-channel="output"/> |
| 74 | + request-channel="inboundLSRecursiveALL" |
| 75 | + command="ls" |
| 76 | + expression="payload" |
| 77 | + command-options="-a -R -dirs" |
| 78 | + mode="REPLACE_IF_MODIFIED" |
| 79 | + filter="dotStarDotTxtFilter" |
| 80 | + local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
| 81 | + local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
| 82 | + reply-channel="output"/> |
83 | 83 |
|
84 | 84 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
85 | | - request-channel="inboundLSRecursiveNoDirs" |
86 | | - command="ls" |
87 | | - expression="payload" |
88 | | - command-options="-R" |
89 | | - mode="REPLACE_IF_MODIFIED" |
90 | | - filter="persistentFilter" |
91 | | - local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
92 | | - local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
93 | | - reply-channel="output"/> |
| 85 | + request-channel="inboundLSRecursiveNoDirs" |
| 86 | + command="ls" |
| 87 | + expression="payload" |
| 88 | + command-options="-R" |
| 89 | + mode="REPLACE_IF_MODIFIED" |
| 90 | + filter="persistentFilter" |
| 91 | + local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
| 92 | + local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
| 93 | + reply-channel="output"/> |
94 | 94 |
|
95 | 95 | <bean id="dotStarDotTxtFilter" |
96 | | - class="org.springframework.integration.sftp.filters.SftpRegexPatternFileListFilter"> |
97 | | - <constructor-arg value="^.*\.txt$" /> |
98 | | - <property name="alwaysAcceptDirectories" value="true" /> |
| 96 | + class="org.springframework.integration.sftp.filters.SftpRegexPatternFileListFilter"> |
| 97 | + <constructor-arg value="^.*\.txt$"/> |
| 98 | + <property name="alwaysAcceptDirectories" value="true"/> |
99 | 99 | </bean> |
100 | 100 |
|
101 | | - <bean id="persistentFilter" class="org.springframework.integration.sftp.filters.SftpPersistentAcceptOnceFileListFilter"> |
| 101 | + <bean id="persistentFilter" |
| 102 | + class="org.springframework.integration.sftp.filters.SftpPersistentAcceptOnceFileListFilter"> |
102 | 103 | <constructor-arg ref="store"/> |
103 | 104 | <constructor-arg value="test"/> |
104 | 105 | <property name="forRecursion" value="true"/> |
|
107 | 108 |
|
108 | 109 | <bean id="store" class="org.springframework.integration.metadata.PropertiesPersistingMetadataStore"> |
109 | 110 | <property name="baseDirectory" |
110 | | - value="#{T(org.springframework.integration.file.remote.RemoteFileTestSupport).getScratchTempFolder().absolutePath}"/> |
| 111 | + value="#{T(org.springframework.integration.file.remote.RemoteFileTestSupport).getScratchTempFolder().absolutePath}"/> |
111 | 112 | </bean> |
112 | 113 |
|
113 | 114 |
|
114 | 115 | <int:channel id="inboundMGetRecursiveFiltered"/> |
115 | 116 |
|
116 | 117 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
117 | | - request-channel="inboundMGetRecursiveFiltered" |
118 | | - command="mget" |
119 | | - expression="payload" |
120 | | - command-options="-R" |
121 | | - filename-regex="(subSftpSource|.*1.txt)" |
122 | | - local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
123 | | - local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
124 | | - reply-channel="output"/> |
| 118 | + request-channel="inboundMGetRecursiveFiltered" |
| 119 | + command="mget" |
| 120 | + expression="payload" |
| 121 | + command-options="-R" |
| 122 | + filename-regex="(subSftpSource|.*1.txt)" |
| 123 | + local-directory-expression="@extraConfig.targetLocalDirectoryName + #remoteDirectory" |
| 124 | + local-filename-generator-expression="#remoteFileName.replaceFirst('sftpSource', 'localTarget')" |
| 125 | + reply-channel="output"/> |
125 | 126 |
|
126 | 127 | <int:channel id="inboundMPut"/> |
127 | 128 |
|
128 | 129 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
129 | | - request-channel="inboundMPut" |
130 | | - command="mput" |
131 | | - auto-create-directory="true" |
132 | | - filename-pattern="*.txt" |
133 | | - expression="payload" |
134 | | - chmod="600" |
135 | | - remote-directory="sftpTarget" |
136 | | - reply-channel="output"/> |
| 130 | + request-channel="inboundMPut" |
| 131 | + command="mput" |
| 132 | + auto-create-directory="true" |
| 133 | + filename-pattern="*.txt" |
| 134 | + expression="payload" |
| 135 | + chmod="600" |
| 136 | + remote-directory="sftpTarget" |
| 137 | + reply-channel="output"/> |
137 | 138 |
|
138 | 139 | <int:channel id="inboundMPutRecursive"/> |
139 | 140 |
|
140 | 141 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
141 | | - request-channel="inboundMPutRecursive" |
142 | | - command="mput" |
143 | | - command-options="-R" |
144 | | - auto-create-directory="true" |
145 | | - filename-pattern="*.txt" |
146 | | - expression="payload" |
147 | | - remote-directory="sftpTarget" |
148 | | - reply-channel="output"/> |
| 142 | + request-channel="inboundMPutRecursive" |
| 143 | + command="mput" |
| 144 | + command-options="-R" |
| 145 | + auto-create-directory="true" |
| 146 | + filename-pattern="*.txt" |
| 147 | + expression="payload" |
| 148 | + remote-directory="sftpTarget" |
| 149 | + reply-channel="output"/> |
149 | 150 |
|
150 | 151 | <int:channel id="inboundMPutRecursiveFiltered"/> |
151 | 152 |
|
152 | 153 | <int-sftp:outbound-gateway session-factory="sftpSessionFactory" |
153 | | - request-channel="inboundMPutRecursiveFiltered" |
154 | | - command="mput" |
155 | | - command-options="-R" |
156 | | - mput-regex="(.*1.txt|sub.*)" |
157 | | - auto-create-directory="true" |
158 | | - filename-pattern="*.txt" |
159 | | - expression="payload" |
160 | | - remote-directory="sftpTarget" |
161 | | - reply-channel="output"/> |
162 | | - |
163 | | - <int:channel id="appending" /> |
| 154 | + request-channel="inboundMPutRecursiveFiltered" |
| 155 | + command="mput" |
| 156 | + command-options="-R" |
| 157 | + mput-regex="(.*1.txt|sub.*)" |
| 158 | + auto-create-directory="true" |
| 159 | + filename-pattern="*.txt" |
| 160 | + expression="payload" |
| 161 | + remote-directory="sftpTarget" |
| 162 | + reply-channel="output"/> |
| 163 | + |
| 164 | + <int:channel id="appending"/> |
164 | 165 |
|
165 | 166 | <int-sftp:outbound-channel-adapter id="appender" |
166 | | - session-factory="sftpSessionFactory" |
167 | | - channel="appending" |
168 | | - mode="APPEND" |
169 | | - use-temporary-file-name="false" |
170 | | - remote-directory="sftpTarget" |
171 | | - auto-create-directory="true" |
172 | | - remote-file-separator="/" /> |
| 167 | + session-factory="sftpSessionFactory" |
| 168 | + channel="appending" |
| 169 | + mode="APPEND" |
| 170 | + use-temporary-file-name="false" |
| 171 | + remote-directory="sftpTarget" |
| 172 | + auto-create-directory="true" |
| 173 | + remote-file-separator="/"/> |
173 | 174 |
|
174 | | - <int:channel id="ignoring" /> |
| 175 | + <int:channel id="ignoring"/> |
175 | 176 |
|
176 | 177 | <int-sftp:outbound-channel-adapter id="ignore" |
177 | | - session-factory="sftpSessionFactory" |
178 | | - channel="ignoring" |
179 | | - mode="IGNORE" |
180 | | - remote-directory="sftpTarget" |
181 | | - auto-create-directory="true" |
182 | | - remote-file-separator="/" /> |
| 178 | + session-factory="sftpSessionFactory" |
| 179 | + channel="ignoring" |
| 180 | + mode="IGNORE" |
| 181 | + remote-directory="sftpTarget" |
| 182 | + auto-create-directory="true" |
| 183 | + remote-file-separator="/"/> |
183 | 184 |
|
184 | | - <int:channel id="failing" /> |
| 185 | + <int:channel id="failing"/> |
185 | 186 |
|
186 | 187 | <int-sftp:outbound-channel-adapter id="fail" |
187 | | - session-factory="sftpSessionFactory" |
188 | | - channel="failing" |
189 | | - mode="FAIL" |
190 | | - remote-directory="sftpTarget" |
191 | | - auto-create-directory="true" |
192 | | - remote-file-separator="/" /> |
| 188 | + session-factory="sftpSessionFactory" |
| 189 | + channel="failing" |
| 190 | + mode="FAIL" |
| 191 | + remote-directory="sftpTarget" |
| 192 | + auto-create-directory="true" |
| 193 | + remote-file-separator="/"/> |
| 194 | + |
| 195 | + <int-sftp:outbound-channel-adapter id="sendFileChannel" |
| 196 | + session-factory="sftpSessionFactory" |
| 197 | + remote-directory="sftpTarget" |
| 198 | + temporary-remote-directory="sftpTarget_tmp" |
| 199 | + auto-create-directory="true"/> |
193 | 200 |
|
194 | 201 | <bean id="cachingSessionFactory" class="org.springframework.integration.file.remote.session.CachingSessionFactory"> |
195 | 202 | <constructor-arg name="sessionFactory" ref="sftpSessionFactory"/> |
|
198 | 205 | </bean> |
199 | 206 |
|
200 | 207 | <int-sftp:outbound-gateway session-factory="cachingSessionFactory" |
201 | | - request-channel="inboundGetStream" |
202 | | - command="get" |
203 | | - command-options="-stream" |
204 | | - expression="payload" |
205 | | - remote-directory="ftpTarget" |
206 | | - reply-channel="stream" /> |
| 208 | + request-channel="inboundGetStream" |
| 209 | + command="get" |
| 210 | + command-options="-stream" |
| 211 | + expression="payload" |
| 212 | + remote-directory="ftpTarget" |
| 213 | + reply-channel="stream"/> |
207 | 214 |
|
208 | 215 | <int:chain input-channel="stream"> |
209 | | - <int-file:splitter markers="true" /> |
| 216 | + <int-file:splitter markers="true"/> |
210 | 217 | <int:payload-type-router resolution-required="false" default-output-channel="output"> |
211 | 218 | <int:mapping type="org.springframework.integration.file.splitter.FileSplitter$FileMarker" |
212 | | - channel="markers" /> |
| 219 | + channel="markers"/> |
213 | 220 | </int:payload-type-router> |
214 | 221 | </int:chain> |
215 | 222 |
|
216 | 223 | <int:service-activator input-channel="markers" |
217 | | - expression="payload.mark.toString().equals('END') ? headers['closeableResource'].close() : null"/> |
| 224 | + expression="payload.mark.toString().equals('END') ? headers['closeableResource'].close() : null"/> |
218 | 225 |
|
219 | 226 | <int-sftp:outbound-gateway |
220 | 227 | session-factory="sftpSessionFactory" |
|
0 commit comments