Author: imario Date: Thu Sep 1 23:04:28 2005 New Revision: 266292 URL: http://svn.apache.org/viewcvs?rev=266292&view=rev Log: enh: check IOException instead of FTPConnectionClosedException to handle cases where we are not able to correctly check if a socked is closed
Modified: jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java Modified: jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt?rev=266292&r1=266291&r2=266292&view=diff ============================================================================== --- jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt (original) +++ jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt Thu Sep 1 23:04:28 2005 @@ -13,7 +13,12 @@ zip, jar, ....: allow filenames without trailing "!" allow createFilesystem with .gz files -better handling of file/folder flag with compressed files +better handling of file/folder flag with compressed files + +ftp: +check IOException instead of FTPConnectionClosedException. +This should make ftp retry more robust even if for some case the state of the +socket isnt correctly reported as closed. 2005-08-13 commons-vfs 1.0 RC3 Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java?rev=266292&r1=266291&r2=266292&view=diff ============================================================================== --- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java (original) +++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java Thu Sep 1 23:04:28 2005 @@ -16,7 +16,6 @@ package org.apache.commons.vfs.provider.ftp; import org.apache.commons.net.ftp.FTPClient; -import org.apache.commons.net.ftp.FTPConnectionClosedException; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.vfs.FileSystemException; import org.apache.commons.vfs.FileSystemOptions; @@ -99,7 +98,7 @@ { return getFtpClient().listFiles(key, relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().listFiles(key, relPath); @@ -112,7 +111,7 @@ { return getFtpClient().removeDirectory(relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().removeDirectory(relPath); @@ -125,7 +124,7 @@ { return getFtpClient().deleteFile(relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().deleteFile(relPath); @@ -138,7 +137,7 @@ { return getFtpClient().rename(oldName, newName); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().rename(oldName, newName); @@ -151,7 +150,7 @@ { return getFtpClient().makeDirectory(relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().makeDirectory(relPath); @@ -174,7 +173,7 @@ { return getFtpClient().retrieveFileStream(relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().retrieveFileStream(relPath); @@ -189,7 +188,7 @@ client.setRestartOffset(restartOffset); return client.retrieveFileStream(relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); @@ -205,7 +204,7 @@ { return getFtpClient().appendFileStream(relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().appendFileStream(relPath); @@ -218,7 +217,7 @@ { return getFtpClient().storeFileStream(relPath); } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); return getFtpClient().storeFileStream(relPath); @@ -233,11 +232,11 @@ // it should be better to really "abort" the transfer, but // currently I didnt manage to make it work - so lets "abort" the hard way. // return getFtpClient().abort(); - + disconnect(); return true; } - catch (FTPConnectionClosedException e) + catch (IOException e) { disconnect(); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]