[jboss-svn-commits] JBL Code SVN: r8753 - 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
Sun Jan 7 14:56:08 EST 2007
Author: b_georges
Date: 2007-01-07 14:56:06 -0500 (Sun, 07 Jan 2007)
New Revision: 8753
Modified:
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
Log:
JBESB-303 - Added debug level logging when we receive the following Exception/message from the FTP Server ""NLST command failed". Other exceptions will be due to wrong permissions. TODO: test with more FTP Servers, forcing permissions and listing errors.
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-07 19:35:02 UTC (rev 8752)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java 2007-01-07 19:56:06 UTC (rev 8753)
@@ -302,17 +302,30 @@
public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception
{
String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
-
try
{
return m_oConn.dir(sSuffix);
}
catch (Exception ex)
- {
- // TODO better error handling. Assume no such file or directory.
+ {
+ String msg = ex.getMessage();
- return null;
+ 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;
+ throw new Exception(sMess);
+ }
+
}
+
}
/*
@@ -453,4 +466,4 @@
m_oConn.rename(sRemoteTmp, sRemoteOK);
}
-}
\ No newline at end of file
+}
More information about the jboss-svn-commits
mailing list