incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: incubator-ftpserver/src/java/org/apache/ftpserver/command APPE.java DELE.java LIST.java MKD.java RETR.java RMD.java STOR.java STOU.java
Date Fri, 09 Sep 2005 11:21:20 GMT
rana_b      2005/09/09 04:21:20

  Modified:    src/java/org/apache/ftpserver/command APPE.java DELE.java
                        LIST.java MKD.java RETR.java RMD.java STOR.java
                        STOU.java
  Log:
  log messages moved from statistics object
  
  Revision  Changes    Path
  1.2       +13 -7     incubator-ftpserver/src/java/org/apache/ftpserver/command/APPE.java
  
  Index: APPE.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/APPE.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- APPE.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ APPE.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -16,6 +16,12 @@
    */
   package org.apache.ftpserver.command;
   
  +import java.io.BufferedInputStream;
  +import java.io.BufferedOutputStream;
  +import java.io.IOException;
  +import java.io.InputStream;
  +import java.net.SocketException;
  +
   import org.apache.ftpserver.Command;
   import org.apache.ftpserver.FtpRequestImpl;
   import org.apache.ftpserver.FtpWriter;
  @@ -24,16 +30,11 @@
   import org.apache.ftpserver.ftplet.FtpException;
   import org.apache.ftpserver.ftplet.Ftplet;
   import org.apache.ftpserver.ftplet.FtpletEnum;
  +import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IFtpConfig;
   import org.apache.ftpserver.interfaces.IFtpStatistics;
   import org.apache.ftpserver.util.IoUtils;
   
  -import java.io.BufferedInputStream;
  -import java.io.BufferedOutputStream;
  -import java.io.IOException;
  -import java.io.InputStream;
  -import java.net.SocketException;
  -
   /**
    * <code>APPE &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
    *
  @@ -130,6 +131,11 @@
                   int maxRate = handler.getRequest().getUser().getMaxUploadRate();
                   long transSz = handler.transfer(bis, bos, maxRate);
                   
  +                // log message
  +                String userName = request.getUser().getName();
  +                Logger logger = fconfig.getLogger();
  +                logger.info("File upload : " + userName + " - " + fileName);
  +                
                   // notify the statistics component
                   IFtpStatistics ftpStat = (IFtpStatistics)fconfig.getFtpStatistics();
                   ftpStat.setUpload(handler, file, transSz);
  
  
  
  1.2       +11 -3     incubator-ftpserver/src/java/org/apache/ftpserver/command/DELE.java
  
  Index: DELE.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/DELE.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DELE.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ DELE.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -16,6 +16,8 @@
    */
   package org.apache.ftpserver.command;
   
  +import java.io.IOException;
  +
   import org.apache.ftpserver.Command;
   import org.apache.ftpserver.FtpRequestImpl;
   import org.apache.ftpserver.FtpWriter;
  @@ -24,11 +26,10 @@
   import org.apache.ftpserver.ftplet.FtpException;
   import org.apache.ftpserver.ftplet.Ftplet;
   import org.apache.ftpserver.ftplet.FtpletEnum;
  +import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IFtpConfig;
   import org.apache.ftpserver.interfaces.IFtpStatistics;
   
  -import java.io.IOException;
  -
   /**
    * <code>DELE &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
    *
  @@ -86,6 +87,13 @@
           // now delete
           if(file.delete()) {
               out.send(250, "DELE", fileName); 
  +            
  +            // log message
  +            String userName = request.getUser().getName();
  +            Logger logger = fconfig.getLogger();
  +            logger.info("File delete : " + userName + " - " + fileName);
  +            
  +            // notify statistics object
               IFtpStatistics ftpStat = (IFtpStatistics)fconfig.getFtpStatistics();
               ftpStat.setDelete(handler, file);
               
  
  
  
  1.2       +2 -2      incubator-ftpserver/src/java/org/apache/ftpserver/command/LIST.java
  
  Index: LIST.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/LIST.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LIST.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ LIST.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -81,7 +81,7 @@
                   
                   // transfer data
                   DirectoryLister dirLister = handler.getDirectoryLister();
  -                syntaxError = !dirLister.printList(request.getArgument(), writer);
  +                syntaxError = !dirLister.doLIST(request.getArgument(), writer);
               }
               catch(SocketException ex) {
                   ex.printStackTrace();
  
  
  
  1.2       +12 -4     incubator-ftpserver/src/java/org/apache/ftpserver/command/MKD.java
  
  Index: MKD.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/MKD.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MKD.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ MKD.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -16,6 +16,8 @@
    */
   package org.apache.ftpserver.command;
   
  +import java.io.IOException;
  +
   import org.apache.ftpserver.Command;
   import org.apache.ftpserver.FtpRequestImpl;
   import org.apache.ftpserver.FtpWriter;
  @@ -24,11 +26,10 @@
   import org.apache.ftpserver.ftplet.FtpException;
   import org.apache.ftpserver.ftplet.Ftplet;
   import org.apache.ftpserver.ftplet.FtpletEnum;
  +import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IFtpConfig;
   import org.apache.ftpserver.interfaces.IFtpStatistics;
   
  -import java.io.IOException;
  -
   /**
    * <code>MKD  &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
    *
  @@ -98,9 +99,16 @@
           
           // now create directory
           if(file.mkdir()) {
  +            out.send(250, "MKD", fileName);
  +            
  +            // write log message
  +            Logger logger = fconfig.getLogger();
  +            String userName = request.getUser().getName();
  +            logger.info("Directory create : " + userName + " - " + fileName);
  +            
  +            // notify statistics object
               IFtpStatistics ftpStat = (IFtpStatistics)handler.getConfig().getFtpStatistics();
               ftpStat.setMkdir(handler, file);
  -            out.send(250, "MKD", fileName); 
               
               // call Ftplet.onMkdirEnd() method
               ftpletRet = ftpletContainer.onMkdirEnd(request, out);
  
  
  
  1.2       +14 -8     incubator-ftpserver/src/java/org/apache/ftpserver/command/RETR.java
  
  Index: RETR.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/RETR.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RETR.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ RETR.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -16,6 +16,13 @@
    */
   package org.apache.ftpserver.command;
   
  +import java.io.BufferedInputStream;
  +import java.io.BufferedOutputStream;
  +import java.io.IOException;
  +import java.io.InputStream;
  +import java.io.OutputStream;
  +import java.net.SocketException;
  +
   import org.apache.ftpserver.Command;
   import org.apache.ftpserver.FtpRequestImpl;
   import org.apache.ftpserver.FtpWriter;
  @@ -24,17 +31,11 @@
   import org.apache.ftpserver.ftplet.FtpException;
   import org.apache.ftpserver.ftplet.Ftplet;
   import org.apache.ftpserver.ftplet.FtpletEnum;
  +import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IFtpConfig;
   import org.apache.ftpserver.interfaces.IFtpStatistics;
   import org.apache.ftpserver.util.IoUtils;
   
  -import java.io.BufferedInputStream;
  -import java.io.BufferedOutputStream;
  -import java.io.IOException;
  -import java.io.InputStream;
  -import java.io.OutputStream;
  -import java.net.SocketException;
  -
   /**
    * <code>RETR &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
    *
  @@ -135,6 +136,11 @@
                   int maxRate = handler.getRequest().getUser().getMaxDownloadRate();
                   long transSz = handler.transfer(bis, bos, maxRate);
                   
  +                // log message
  +                String userName = request.getUser().getName();
  +                Logger logger = fconfig.getLogger();
  +                logger.info("File download : " + userName + " - " + fileName);
  +                
                   // notify the statistics component
                   IFtpStatistics ftpStat = (IFtpStatistics)fconfig.getFtpStatistics();
                   ftpStat.setDownload(handler, file, transSz);
  
  
  
  1.2       +12 -4     incubator-ftpserver/src/java/org/apache/ftpserver/command/RMD.java
  
  Index: RMD.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/RMD.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RMD.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ RMD.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -16,6 +16,8 @@
    */
   package org.apache.ftpserver.command;
   
  +import java.io.IOException;
  +
   import org.apache.ftpserver.Command;
   import org.apache.ftpserver.FtpRequestImpl;
   import org.apache.ftpserver.FtpWriter;
  @@ -24,11 +26,10 @@
   import org.apache.ftpserver.ftplet.FtpException;
   import org.apache.ftpserver.ftplet.Ftplet;
   import org.apache.ftpserver.ftplet.FtpletEnum;
  +import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IFtpConfig;
   import org.apache.ftpserver.interfaces.IFtpStatistics;
   
  -import java.io.IOException;
  -
   /**
    * <code>RMD  &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
    *
  @@ -98,9 +99,16 @@
           
           // now delete directory
           if(file.delete()) {
  +            out.send(250, "RMD", fileName); 
  +            
  +            // write log message
  +            Logger logger = fconfig.getLogger();
  +            String userName = request.getUser().getName();
  +            logger.info("Directory remove : " + userName + " - " + fileName);
  +            
  +            // notify statistics object
               IFtpStatistics ftpStat = (IFtpStatistics)fconfig.getFtpStatistics();
               ftpStat.setRmdir(handler, file);
  -            out.send(250, "RMD", fileName); 
               
               // call Ftplet.onRmdirEnd() method
               ftpletRet = ftpletContainer.onRmdirEnd(request, out);
  
  
  
  1.2       +7 -1      incubator-ftpserver/src/java/org/apache/ftpserver/command/STOR.java
  
  Index: STOR.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/STOR.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- STOR.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ STOR.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -24,6 +24,7 @@
   import org.apache.ftpserver.ftplet.FtpException;
   import org.apache.ftpserver.ftplet.Ftplet;
   import org.apache.ftpserver.ftplet.FtpletEnum;
  +import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IFtpConfig;
   import org.apache.ftpserver.interfaces.IFtpStatistics;
   import org.apache.ftpserver.util.IoUtils;
  @@ -125,6 +126,11 @@
                   int maxRate = handler.getRequest().getUser().getMaxUploadRate();
                   long transSz = handler.transfer(bis, bos, maxRate);
                   
  +                // log message
  +                String userName = request.getUser().getName();
  +                Logger logger = fconfig.getLogger();
  +                logger.info("File upload : " + userName + " - " + fileName);
  +                
                   // notify the statistics component
                   IFtpStatistics ftpStat = (IFtpStatistics)fconfig.getFtpStatistics();
                   ftpStat.setUpload(handler, file, transSz);
  
  
  
  1.2       +7 -1      incubator-ftpserver/src/java/org/apache/ftpserver/command/STOU.java
  
  Index: STOU.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/command/STOU.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- STOU.java	7 Sep 2005 05:06:22 -0000	1.1
  +++ STOU.java	9 Sep 2005 11:21:20 -0000	1.2
  @@ -31,6 +31,7 @@
   import org.apache.ftpserver.ftplet.FtpException;
   import org.apache.ftpserver.ftplet.Ftplet;
   import org.apache.ftpserver.ftplet.FtpletEnum;
  +import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IFtpConfig;
   import org.apache.ftpserver.interfaces.IFtpStatistics;
   import org.apache.ftpserver.util.IoUtils;
  @@ -118,6 +119,11 @@
                   int maxRate = handler.getRequest().getUser().getMaxUploadRate();
                   long transSz = handler.transfer(bis, bos, maxRate);
                   
  +                // log message
  +                String userName = request.getUser().getName();
  +                Logger logger = fconfig.getLogger();
  +                logger.info("File upload : " + userName + " - " + fileName);
  +                
                   // notify the statistics component
                   IFtpStatistics ftpStat = (IFtpStatistics)fconfig.getFtpStatistics();
                   ftpStat.setUpload(handler, file, transSz);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message