File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
spring-integration-ftp/src
main/java/org/springframework/integration/ftp/session
test/java/org/springframework/integration/ftp/session Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 3838 * @author Oleg Zhurakousky
3939 * @author Gary Russell
4040 * @author Artem Bilan
41+ * @author Den Ivanov
4142 *
4243 * @since 2.0
4344 */
@@ -154,7 +155,9 @@ public void close() {
154155 if (this .readingRaw .get () && !finalizeRaw () && LOGGER .isWarnEnabled ()) {
155156 LOGGER .warn ("Finalize on readRaw() returned false for " + this );
156157 }
157- this .client .logout ();
158+ if (this .client .isConnected ()) {
159+ this .client .logout ();
160+ }
158161 this .client .disconnect ();
159162 }
160163 catch (Exception e ) {
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ protected FTPClient createClientInstance() {
6969 sessionFactory .setDataTimeout (789 );
7070 doReturn (200 ).when (client ).getReplyCode ();
7171 doReturn (true ).when (client ).login ("foo" , null );
72+ doReturn (true ).when (client ).isConnected ();
7273 FtpSession session = sessionFactory .getSession ();
7374 verify (client ).setConnectTimeout (123 );
7475 verify (client ).setDefaultTimeout (456 );
@@ -210,7 +211,6 @@ void testConnectionLimit() throws Exception {
210211 session .close ();
211212 }
212213 catch (Exception e ) {
213- e .printStackTrace ();
214214 failures .incrementAndGet ();
215215 }
216216 });
You can’t perform that action at this time.
0 commit comments