Author: ecki
Date: Wed Sep 23 19:55:57 2015
New Revision: 1704927

URL: http://svn.apache.org/viewvc?rev=1704927&view=rev
Log:
[VFS-567][ftp] Ignore exceptions on disconnect.

Modified:
    
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FTPClientWrapper.java
    commons/proper/vfs/trunk/src/changes/changes.xml

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FTPClientWrapper.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FTPClientWrapper.java?rev=1704927&r1=1704926&r2=1704927&view=diff
==============================================================================
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FTPClientWrapper.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FTPClientWrapper.java
 Wed Sep 23 19:55:57 2015
@@ -20,6 +20,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.net.ftp.FTPClient;
 import org.apache.commons.net.ftp.FTPFile;
 import org.apache.commons.net.ftp.FTPReply;
@@ -37,6 +39,9 @@ import org.apache.commons.vfs2.util.User
  */
 public class FTPClientWrapper implements FtpClient
 {
+    
+    private static final Log LOG = LogFactory.getLog(FTPClientWrapper.class);
+    
     protected final FileSystemOptions fileSystemOptions;
     private final GenericFileName root;
     private FTPClient ftpClient;
@@ -112,12 +117,20 @@ public class FTPClientWrapper implements
         {
             getFtpClient().quit();
         }
+        catch (IOException e)
+        {
+            LOG.debug("I/O exception while trying to quit, probably it's a 
timed out connection, ignoring.", e);
+        }
         finally
         {
             try
             {
                 getFtpClient().disconnect();
             }
+            catch (IOException e)
+            {
+                LOG.warn("I/O exception while trying to disconnect, probably 
it's a closed connection, ignoring.", e);
+            }
             finally
             {
                 ftpClient = null;

Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1704927&r1=1704926&r2=1704927&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Wed Sep 23 19:55:57 2015
@@ -26,6 +26,9 @@
 <!--       <action issue="VFS-443" dev="ggregory" type="update" 
due-to="nickallen"> -->
 <!--        [Local] Need an easy way to convert from a FileObject to a File. 
-->
 <!--       </action> -->
+      <action issue="VFS-567" dev="ecki" type="fix" due-to="Antonio Petrelli">
+        [ftp] Ignore exceptions while QUIT/disconnect.
+     </action>
       <action issue="VFS-572" dev="ecki" type="fix" due-to="Sandra Parsick">
         [sftp] better documentation for knownhosts file option.
      </action>


Reply via email to