incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r490574 - in /incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver: ./ command/ usermanager/
Date Wed, 27 Dec 2006 21:56:35 GMT
Author: ngn
Date: Wed Dec 27 13:56:33 2006
New Revision: 490574

URL: http://svn.apache.org/viewvc?view=rev&rev=490574
Log:
Adding decent logging of exceptions (FTPSERVER-56). Thanks to Mark Proctor for the suggestion.

Modified:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultListener.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/RequestHandler.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultListener.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultListener.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultListener.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/DefaultListener.java Wed
Dec 27 13:56:33 2006
@@ -3,6 +3,7 @@
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.net.SocketException;
 
 import org.apache.commons.logging.Log;
 import org.apache.ftpserver.interfaces.Connection;
@@ -87,7 +88,10 @@
 
                 Connection connection = new RequestHandler(serverContext, soc);
                 conManager.newConnection(connection);
+            } catch (SocketException ex) {
+                return;
             } catch (Exception ex) {
+                log.debug("Listener ending", ex);
                 return;
             }
         }
@@ -103,6 +107,7 @@
             try {
                 serverSocket.close();
             } catch (IOException ex) {
+                // ignore
             }
             serverSocket = null;
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpWriter.java Wed Dec 27
13:56:33 2006
@@ -223,6 +223,7 @@
             sr.close();
         }
         catch(IOException ex) {
+            log.debug("Exception creating output line", ex);
         }
         return buff.toString();
     }
@@ -558,6 +559,7 @@
                     varVal = fsView.getCurrentDirectory().getFullName();
                 }
                 catch(Exception ex) {
+                    log.debug("Exception getting name of file object", ex);
                 }
             }
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/RequestHandler.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/RequestHandler.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/RequestHandler.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/RequestHandler.java Wed Dec
27 13:56:33 2006
@@ -72,7 +72,6 @@
     private BufferedReader reader;
     private boolean isConnectionClosed;
     
-    private DirectoryLister directoryLister;
     private DataType dataType    = DataType.ASCII;
     private Structure structure  = Structure.FILE;
     private Map attributes = new HashMap();

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java Wed Dec
27 13:56:33 2006
@@ -78,7 +78,7 @@
             try {
                 ftpletRet = ftpletContainer.onAppendStart(request, out);
             } catch(Exception e) {
-                
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -94,7 +94,8 @@
             try {
                 file = request.getFileSystemView().getFileObject(fileName);
             }
-            catch(Exception ex) {
+            catch(Exception e) {
+                log.debug("File system threw exception", e);
             }
             if(file == null) {
                 out.send(550, "APPE.invalid", fileName);
@@ -120,7 +121,8 @@
             try {
                 is = request.getDataInputStream();
             }
-            catch(IOException ex) {
+            catch(IOException e) {
+                log.debug("Exception when getting data input stream", e);
                 out.send(425, "APPE", fileName);
                 return;
             }
@@ -154,11 +156,13 @@
                 ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
                 ftpStat.setUpload(handler, file, transSz);
             }
-            catch(SocketException ex) {
+            catch(SocketException e) {
+                log.debug("SocketException during file upload", e);
                 failure = true;
                 out.send(426, "APPE", fileName);
             }
-            catch(IOException ex) {
+            catch(IOException e) {
+                log.debug("IOException during file upload", e);
                 failure = true;
                 out.send(551, "APPE", fileName);
             }
@@ -175,6 +179,7 @@
                 try {
                     ftpletRet = ftpletContainer.onAppendEnd(request, out);
                 } catch(Exception e) {
+                    log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CDUP.java Wed Dec
27 13:56:33 2006
@@ -58,6 +58,7 @@
             success = fsview.changeDirectory("..");
         }
         catch(Exception ex) {
+            log.debug("Failed to change directory in file system", ex);
         }
         if(success) {
             String dirName = fsview.getCurrentDirectory().getFullName();

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/CWD.java Wed Dec
27 13:56:33 2006
@@ -64,6 +64,7 @@
             success = fsview.changeDirectory(dirName);
         }
         catch(Exception ex) {
+            log.debug("Failed to change directory in file system", ex);
         }
         if(success) {
             dirName = fsview.getCurrentDirectory().getFullName();

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/DELE.java Wed Dec
27 13:56:33 2006
@@ -68,6 +68,7 @@
         try {
             ftpletRet = ftpletContainer.onDeleteStart(request, out);
         } catch(Exception e) {
+            log.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
         }
         if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -86,7 +87,7 @@
             file = request.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
-            // TODO: handle exception
+            log.debug("Could not get file " + fileName, ex);
         }
         if(file == null) {
             out.send(550, "DELE.invalid", fileName);
@@ -118,6 +119,7 @@
             try{
                 ftpletRet = ftpletContainer.onDeleteEnd(request, out);
             } catch(Exception e) {
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPRT.java Wed Dec
27 13:56:33 2006
@@ -75,6 +75,7 @@
             port = arg.substring(lastDelimIdx+1, arg.length() - 1);
         }
         catch(Exception ex) {
+            log.debug("Exception parsing host and port: " + arg, ex);
             out.send(510, "EPRT", null);
             return;
         }
@@ -85,6 +86,7 @@
             dataAddr = InetAddress.getByName(host);
         }
         catch(UnknownHostException ex) {
+            log.debug("Unknown host: " + host, ex);
             out.send(553, "EPRT.host", null);
             return;
         }
@@ -104,6 +106,7 @@
             dataPort = Integer.parseInt(port);     
         }
         catch(NumberFormatException ex) {
+            log.debug("Invalid port: " + port, ex);
             out.send(552, "EPRT.invalid", null); 
             return; 
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java Wed Dec
27 13:56:33 2006
@@ -74,6 +74,7 @@
                 os = request.getDataOutputStream();
             }
             catch(IOException ex) {
+                log.debug("Exception getting the output data stream", ex);
                 out.send(425, "LIST", null);
                 return;
             }
@@ -92,15 +93,16 @@
                 writer.write(directoryLister.listFiles(parsedArg, request.getFileSystemView(),
LIST_FILE_FORMATER));
             }
             catch(SocketException ex) {
-                ex.printStackTrace();
+                log.debug("Socket exception during list transfer", ex);
                 failure = true;
                 out.send(426, "LIST", null);
             }
             catch(IOException ex) {
-                ex.printStackTrace();
+                log.debug("IOException during list transfer", ex);
                 failure = true;
                 out.send(551, "LIST", null);
             } catch(IllegalArgumentException e) {
+                log.debug("Illegal list syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.send(501, "LIST", null);
             } finally {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MD5.java Wed Dec
27 13:56:33 2006
@@ -84,6 +84,7 @@
                 file = request.getFileSystemView().getFileObject(fileName);
             }
             catch(Exception ex) {
+                log.debug("Exception getting the file object: " + fileName, ex);
                 // TODO: handle exception
             }
             
@@ -112,6 +113,7 @@
                 sb.append(md5Hash);
                 
             } catch(NoSuchAlgorithmException e) {
+                log.debug("MD5 algorithm not available", e);
                 out.send(502, "MD5.notimplemened", null);
             } finally {
                 IoUtils.close(is);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MDTM.java Wed Dec
27 13:56:33 2006
@@ -61,6 +61,7 @@
             file = request.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
+            log.debug("Exception getting file object", ex);
         }
         if(file == null) {
             out.send(550, "MDTM", fileName);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MKD.java Wed Dec
27 13:56:33 2006
@@ -70,6 +70,7 @@
         try{
             ftpletRet = ftpletContainer.onMkdirStart(request, out);
         } catch(Exception e) {
+            log.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
         }
         if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -86,6 +87,7 @@
             file = request.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
+            log.debug("Exception getting file object", ex);
         }
         if(file == null) {
             out.send(550, "MKD.invalid", fileName);
@@ -122,6 +124,7 @@
             try{
                 ftpletRet = ftpletContainer.onMkdirEnd(request, out);
             } catch(Exception e) {
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java Wed Dec
27 13:56:33 2006
@@ -71,6 +71,7 @@
                 os = request.getDataOutputStream();
             }
             catch(IOException ex) {
+                log.debug("Exception getting the output data stream", ex);
                 out.send(425, "MLSD", null);
                 return;
             }
@@ -90,13 +91,16 @@
                 writer.write(directoryLister.listFiles(parsedArg, request.getFileSystemView(),
formater));
             }
             catch(SocketException ex) {
+                log.debug("Socket exception during data transfer", ex);
                 failure = true;
                 out.send(426, "MLSD", null);
             }
             catch(IOException ex) {
+                log.debug("IOException during data transfer", ex);
                 failure = true;
                 out.send(551, "MLSD", null);
             } catch(IllegalArgumentException e) {
+                log.debug("Illegal listing syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.send(501, "MLSD", null);
             }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLST.java Wed Dec
27 13:56:33 2006
@@ -65,6 +65,7 @@
             }
         }
         catch(FtpException ex) {
+            log.debug("Exception sending the file listing", ex);
             out.send(501, "MLST", null);
         }     
     }   

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java Wed Dec
27 13:56:33 2006
@@ -75,6 +75,7 @@
                 os = request.getDataOutputStream();
             }
             catch(IOException ex) {
+                log.debug("Exception getting the output data stream", ex);
                 out.send(425, "NLST", null);
                 return;
             }
@@ -100,13 +101,16 @@
                 writer.write(directoryLister.listFiles(parsedArg, request.getFileSystemView(),
formater));
             }
             catch(SocketException ex) {
+                log.debug("Socket exception during data transfer", ex);
                 failure = true;
                 out.send(426, "NLST", null);
             }
             catch(IOException ex) {
+                log.debug("IOException during data transfer", ex);
                 failure = true;
                 out.send(551, "NLST", null);
             } catch(IllegalArgumentException e) {
+                log.debug("Illegal listing syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.send(501, "LIST", null);
             } finally {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASS.java Wed Dec
27 13:56:33 2006
@@ -127,7 +127,7 @@
                     try {
                         userMetadata.setCertificateChain(sslControlSocket.getSession().getPeerCertificates());
                     } catch(SSLPeerUnverifiedException e) {
-                        // ignore
+                        // ignore, certificate will not be available to UserManager
                     }
                 }
                 
@@ -174,6 +174,7 @@
                 try{
                     ftpletRet = ftpletContainer.onLogin(request, out);
                 } catch(Exception e) {
+                    log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PORT.java Wed Dec
27 13:56:33 2006
@@ -89,6 +89,7 @@
             dataAddr = InetAddress.getByName(dataSrvName);
         }
         catch(UnknownHostException ex) {
+            log.debug("Unknown host: " + dataSrvName, ex);
             out.send(553, "PORT.host", null);
             return;
         }
@@ -110,6 +111,7 @@
             dataPort = (hi << 8) | lo;     
         }
         catch(NumberFormatException ex) {
+            log.debug("Invalid data port: " + request.getArgument(), ex);
             out.send(552, "PORT.invalid", null); 
             return; 
         }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REST.java Wed Dec
27 13:56:33 2006
@@ -70,6 +70,7 @@
             }
         }
         catch(NumberFormatException ex) {
+            log.debug("Invalid restart position: " + argument, ex);
             out.send(501, "REST.invalid", null); 
         }
         

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java Wed Dec
27 13:56:33 2006
@@ -79,6 +79,7 @@
             try {
                 ftpletRet = ftpletContainer.onDownloadStart(request, out);
             } catch(Exception e) {
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -95,6 +96,7 @@
                 file = request.getFileSystemView().getFileObject(fileName);
             }
             catch(Exception ex) {
+                log.debug("Exception getting file object", ex);
             }
             if(file == null) {
                 out.send(550, "RETR.missing", fileName);
@@ -127,6 +129,7 @@
                 os = request.getDataOutputStream();
             }
             catch(IOException ex) {
+                log.debug("Exception getting the output data stream", ex);
                 out.send(425, "RETR", null);
                 return;
             }
@@ -155,10 +158,12 @@
                 ftpStat.setDownload(handler, file, transSz);
             }
             catch(SocketException ex) {
+                log.debug("Socket exception during data transfer", ex);
                 failure = true;
                 out.send(426, "RETR", fileName);
             }
             catch(IOException ex) {
+                log.debug("IOException during data transfer", ex);
                 failure = true;
                 out.send(551, "RETR", fileName);
             }
@@ -175,6 +180,7 @@
                 try {
                     ftpletRet = ftpletContainer.onDownloadEnd(request, out);
                 } catch(Exception e) {
+                    log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RMD.java Wed Dec
27 13:56:33 2006
@@ -70,6 +70,7 @@
         try{
             ftpletRet = ftpletContainer.onRmdirStart(request, out);
         } catch(Exception e) {
+            log.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
         }
         if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -86,6 +87,7 @@
             file = request.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
+            log.debug("Exception getting file object", ex);
         }
         if(file == null) {
             out.send(550, "RMD.permission", fileName);
@@ -122,6 +124,7 @@
             try{
                 ftpletRet = ftpletContainer.onRmdirEnd(request, out);
             } catch(Exception e) {
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java Wed Dec
27 13:56:33 2006
@@ -62,6 +62,7 @@
             renFr = request.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
+            log.debug("Exception getting file object", ex);
         }
             
         // check file

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNTO.java Wed Dec
27 13:56:33 2006
@@ -67,6 +67,7 @@
             try {
                 ftpletRet = ftpletContainer.onRenameStart(request, out);
             } catch(Exception e) {
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -90,6 +91,7 @@
                 toFile = request.getFileSystemView().getFileObject(toFileStr);
             }
             catch(Exception ex) {
+                log.debug("Exception getting file object", ex);
             }
             if(toFile == null) {
                 out.send(553, "RNTO.invalid", null);
@@ -121,6 +123,7 @@
                 try {
                     ftpletRet = ftpletContainer.onRenameEnd(request, out);
                 } catch(Exception e) {
+                    log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE.java Wed Dec
27 13:56:33 2006
@@ -58,6 +58,7 @@
         try {
             ftpletRet = ftpletContainer.onSite(request, out);
         } catch(Exception e) {
+            log.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
         }
         if(ftpletRet == FtpletEnum.RET_SKIP) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SIZE.java Wed Dec
27 13:56:33 2006
@@ -60,6 +60,7 @@
             file = request.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
+            log.debug("Exception getting file object", ex);
         }
         if(file == null) {
             out.send(550, "SIZE.missing", fileName);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java Wed Dec
27 13:56:33 2006
@@ -80,6 +80,7 @@
             try {
                 ftpletRet = ftpletContainer.onUploadStart(request, out);
             } catch(Exception e) {
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -96,6 +97,7 @@
                 file = request.getFileSystemView().getFileObject(fileName);
             }
             catch(Exception ex) {
+                log.debug("Exception getting file object", ex);
             }
             if(file == null) {
                 out.send(550, "STOR.invalid", fileName);
@@ -116,6 +118,7 @@
                 is = request.getDataInputStream();
             }
             catch(IOException ex) {
+                log.debug("Exception getting the input data stream", ex);
                 out.send(425, "STOR", fileName);
                 return;
             }
@@ -144,10 +147,12 @@
                 ftpStat.setUpload(handler, file, transSz);
             }
             catch(SocketException ex) {
+                log.debug("Socket exception during data transfer", ex);
                 failure = true;
                 out.send(426, "STOR", fileName);
             }
             catch(IOException ex) {
+                log.debug("IOException during data transfer", ex);
                 failure = true;
                 out.send(551, "STOR", fileName);
             }
@@ -164,6 +169,7 @@
                 try {
                     ftpletRet = ftpletContainer.onUploadEnd(request, out);
                 } catch(Exception e) {
+                    log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java Wed Dec
27 13:56:33 2006
@@ -71,6 +71,7 @@
             try {
                 ftpletRet = ftpletContainer.onUploadUniqueStart(request, out);
             } catch(Exception e) {
+                log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
             }
             if(ftpletRet == FtpletEnum.RET_SKIP) {
@@ -99,6 +100,7 @@
                 }
             }
             catch(Exception ex) {
+                log.debug("Exception getting file object", ex);
             }
             if(file == null) {
                 out.send(550, "STOU", null);
@@ -119,6 +121,7 @@
                 is = request.getDataInputStream();
             }
             catch(IOException ex) {
+                log.debug("Exception getting the input data stream", ex);
                 out.send(425, "STOU", fileName);
                 return;
             }
@@ -150,10 +153,12 @@
                 }
             }
             catch(SocketException ex) {
+                log.debug("Socket exception during data transfer", ex);
                 failure = true;
                 out.send(426, "STOU", fileName);
             }
             catch(IOException ex) {
+                log.debug("IOException during data transfer", ex);
                 failure = true;
                 out.send(551, "STOU", fileName);
             }
@@ -170,6 +175,7 @@
                 try {
                     ftpletRet = ftpletContainer.onUploadUniqueEnd(request, out);
                 } catch(Exception e) {
+                    log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
                 }
                 if(ftpletRet == FtpletEnum.RET_DISCONNECT) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java Wed Dec
27 13:56:33 2006
@@ -60,6 +60,7 @@
             out.send(200, "STRU", null);
         } 
         catch(IllegalArgumentException e) {
+            log.debug("Illegal structure argument: " + request.getArgument(), e);
             out.send(504, "STRU", null);
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java Wed Dec
27 13:56:33 2006
@@ -58,6 +58,7 @@
             out.send(200, "TYPE", null);
         } 
         catch(IllegalArgumentException e) {
+            log.debug("Illegal type argument: " + request.getArgument(), e);
             out.send(504, "TYPE", null);
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java?view=diff&rev=490574&r1=490573&r2=490574
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java
(original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/usermanager/LdapUserManager.java
Wed Dec 27 13:56:33 2006
@@ -174,6 +174,7 @@
             user = (User)adminContext.lookup(dn);
         }
         catch(NamingException ex) {
+            log.debug("Failed to retrive user: " + name, ex);
             user = null;
         }
         return user;



Mime
View raw message