[jboss-svn-commits] JBL Code SVN: r8761 - labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/util
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Jan 8 09:45:16 EST 2007
Author: b_georges
Date: 2007-01-08 09:45:14 -0500 (Mon, 08 Jan 2007)
New Revision: 8761
Modified:
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
Log:
Removed FTP Server Exception message comparison, the getReplycode provides a safer mechanism.
Added debug when catching 550 FTP Ret Code.
Will look like:
[java] 15:41:56,626 DEBUG [Thread-5][EdtFtpImpl] No matching file or directory. Server returns: [550] NLST command failed
Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java 2007-01-08 14:41:35 UTC (rev 8760)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java 2007-01-08 14:45:14 UTC (rev 8761)
@@ -316,27 +316,23 @@
}
catch (FTPException ex)
{
- if (ex.getReplyCode() == 550) // means File Not Found
- return null;
-
- String msg = ex.getMessage();
-
- if(msg.equals("NLST command failed")) // despite correct permission this may happen in some FTP servers
- {
- _logger.debug("No matching file or directory. Server returns the following message: "+ msg);
- return null;
- }
- else
- {
- // What about wrong permissions?
- // TODO Test with different FTP Servers
- String sMess = this.getClass().getSimpleName()
- + " can't list "+ sSuffix + " due to: " + msg;
+ String msg = ex.getMessage();
+ int rc = ex.getReplyCode();
+ if (rc == 550) // means File Not Found - see JBESB-303
+ {
+ _logger.debug("No matching file or directory. Server returns: ["+ rc+"] "+msg);
+ return null;
+ }
+ else
+ {
+ // TODO Test with different FTP Servers
+ String sMess = this.getClass().getSimpleName()
+ + " can't list "+ sSuffix + " due to: [" + rc + "] "+msg;
throw new Exception(sMess);
- }
- }
- }
-
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
More information about the jboss-svn-commits
mailing list