incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r491831 [2/4] - in /incubator/ftpserver/trunk: admin-gui/src/java/org/apache/ftpserver/gui/ core/src/java/org/apache/ftpserver/ core/src/java/org/apache/ftpserver/command/ core/src/java/org/apache/ftpserver/ftplet/ core/src/java/org/apache/...
Date Tue, 02 Jan 2007 16:17:26 GMT
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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -25,10 +25,11 @@
 import java.io.Writer;
 import java.net.SocketException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.listing.DirectoryLister;
 import org.apache.ftpserver.listing.FileFormater;
 import org.apache.ftpserver.listing.ListArgument;
@@ -56,19 +57,20 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         try {
             
             // reset state
-            request.resetState();
+            session.resetState();
             
             // get data connection
             out.send(150, "MLSD", null);
             OutputStream os = null;
             try {
-                os = request.getDataOutputStream();
+                os = session.getDataOutputStream();
             }
             catch(IOException ex) {
                 log.debug("Exception getting the output data stream", ex);
@@ -88,7 +90,7 @@
                 ListArgument parsedArg = ListArgumentParser.parse(request.getArgument());
                 
                 FileFormater formater = new MLSTFileFormater((String[])handler.getAttribute("MLST.types"));
-                writer.write(directoryLister.listFiles(parsedArg, request.getFileSystemView(), formater));
+                writer.write(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
             }
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
@@ -115,7 +117,7 @@
             }
         }
         finally {
-            request.getFtpDataConnection().closeDataSocket();
+            session.getFtpDataConnection().closeDataSocket();
         }
     }
 }

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -21,11 +21,12 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.listing.FileFormater;
 import org.apache.ftpserver.listing.ListArgument;
 import org.apache.ftpserver.listing.ListArgumentParser;
@@ -45,18 +46,19 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
 //      parse argument
         ListArgument parsedArg = ListArgumentParser.parse(request.getArgument());
         
         FileObject file = null;
         try {
-            file = request.getFileSystemView().getFileObject(parsedArg.getFile());
+            file = session.getFileSystemView().getFileObject(parsedArg.getFile());
             if(file != null && file.doesExist()) {
                 FileFormater formater = new MLSTFileFormater((String[])handler.getAttribute("MLST.types"));
                 out.send(250, "MLST", formater.format(file));

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MODE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MODE.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MODE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MODE.java Tue Jan  2 08:17:22 2007
@@ -21,9 +21,10 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>MODE &lt;SP&gt; <mode-code> &lt;CRLF&gt;</code><br>
@@ -41,11 +42,12 @@
      * Execute command
      */
     public void execute(RequestHandler handler,
-                       FtpRequestImpl request, 
+                       FtpRequest request,
+                       FtpSessionImpl session, 
                        FtpWriter out) throws IOException {
         
         // reset state
-        request.resetState();
+        session.resetState();
         
         // argument check
         if(!request.hasArgument()) {
@@ -57,11 +59,11 @@
         char md = request.getArgument().charAt(0);
         md = Character.toUpperCase(md);
         if(md == 'S') {
-            request.getFtpDataConnection().setZipMode(false);
+            session.getFtpDataConnection().setZipMode(false);
             out.send(200, "MODE", "S");
         }
         else if(md == 'Z') {
-            request.getFtpDataConnection().setZipMode(true);
+            session.getFtpDataConnection().setZipMode(true);
             out.send(200, "MODE", "Z");
         }
         else {

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -25,10 +25,11 @@
 import java.io.Writer;
 import java.net.SocketException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.listing.DirectoryLister;
 import org.apache.ftpserver.listing.FileFormater;
 import org.apache.ftpserver.listing.LISTFileFormater;
@@ -60,19 +61,20 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         try {
             
             // reset state
-            request.resetState();
+            session.resetState();
             
             // get data connection
             out.send(150, "NLST", null);
             OutputStream os = null;
             try {
-                os = request.getDataOutputStream();
+                os = session.getDataOutputStream();
             }
             catch(IOException ex) {
                 log.debug("Exception getting the output data stream", ex);
@@ -98,7 +100,7 @@
                     formater = NLST_FILE_FORMATER;
                 }
                 
-                writer.write(directoryLister.listFiles(parsedArg, request.getFileSystemView(), formater));
+                writer.write(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
             }
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
@@ -124,7 +126,7 @@
             }
         }
         finally {
-            request.getFtpDataConnection().closeDataSocket();
+            session.getFtpDataConnection().closeDataSocket();
         }
     }
 }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NOOP.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NOOP.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NOOP.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NOOP.java Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>NOOP &lt;CRLF&gt;</code><br>
@@ -42,10 +43,11 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request, 
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
-        request.resetState();
+        session.resetState();
         out.send(200, "NOOP", null);
     }
 }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS.java Tue Jan  2 08:17:22 2007
@@ -23,10 +23,11 @@
 import java.util.HashMap;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.interfaces.Command;
 
 
@@ -48,11 +49,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state
-        request.resetState();
+        session.resetState();
         
         // no params
         String argument = request.getArgument();
@@ -73,17 +75,17 @@
         Command command = (Command)COMMAND_MAP.get( optsRequest );
         try {
             if(command != null) {
-                command.execute(handler, request, out);
+                command.execute(handler, request, session, out);
             }
             else {
-                request.resetState();
+                session.resetState();
                 out.send(502, "OPTS.not.implemented", argument);
             }
         }
         catch(Exception ex) {
             Log log = handler.getServerContext().getLogFactory().getInstance(getClass());
             log.warn("OPTS.execute()", ex);
-            request.resetState();
+            session.resetState();
             out.send(500, "OPTS", null);
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_MLST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_MLST.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_MLST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_MLST.java Tue Jan  2 08:17:22 2007
@@ -22,10 +22,11 @@
 import java.io.IOException;
 import java.util.StringTokenizer;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * Client-Server listing negotation.
@@ -48,11 +49,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request, 
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state
-        request.resetState();
+        session.resetState();
         
         // get the listing types
         String argument = request.getArgument();

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_UTF8.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_UTF8.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_UTF8.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/OPTS_UTF8.java Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 
 /**
@@ -42,11 +43,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state
-        request.resetState();
+        session.resetState();
         
         // send default message
         out.send(200, "OPTS.UTF8", null);

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -26,7 +26,7 @@
 import javax.net.ssl.SSLSocket;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.Authentication;
@@ -34,6 +34,7 @@
 import org.apache.ftpserver.ftplet.FileSystemManager;
 import org.apache.ftpserver.ftplet.FileSystemView;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.ftplet.User;
@@ -61,7 +62,8 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
     
         boolean success = false;
@@ -72,7 +74,7 @@
         try {
             
             // reset state variables
-            request.resetState();
+            session.resetState();
             
             // argument check
             String password = request.getArgument();
@@ -82,15 +84,15 @@
             }
             
             // check user name
-            String userName = request.getUserArgument();
+            String userName = session.getUserArgument();
 
-            if(userName == null && request.getUser() == null) {
+            if(userName == null && session.getUser() == null) {
                 out.send(503, "PASS", null);
                 return;
             }
             
             // already logged-in
-            if(request.isLoggedIn()) {
+            if(session.isLoggedIn()) {
                 out.send(202, "PASS", null);
                 success = true;
                 return;
@@ -155,16 +157,16 @@
             
             // first save old values so that we can reset them if Ftplets
             // tell us to fail
-            User oldUser = request.getUser();
-            String oldUserArgument = request.getUserArgument();
-            int oldMaxIdleTime = request.getMaxIdleTime();
+            User oldUser = session.getUser();
+            String oldUserArgument = session.getUserArgument();
+            int oldMaxIdleTime = session.getMaxIdleTime();
 
             if(success) {
-                request.setUser(authenticatedUser);
-                request.setUserArgument(null);
-                request.setMaxIdleTime(authenticatedUser.getMaxIdleTime());
+                session.setUser(authenticatedUser);
+                session.setUserArgument(null);
+                session.setMaxIdleTime(authenticatedUser.getMaxIdleTime());
             } else {
-                request.setUser(null);
+                session.setUser(null);
             }
             
             // call Ftplet.onLogin() method
@@ -172,7 +174,7 @@
             if(ftpletContainer != null) {
                 FtpletEnum ftpletRet;
                 try{
-                    ftpletRet = ftpletContainer.onLogin(request, out);
+                    ftpletRet = ftpletContainer.onLogin(session, request, out);
                 } catch(Exception e) {
                     log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -187,9 +189,9 @@
             
             if(!success) {
                 // reset due to failure
-                request.setUser(oldUser);
-                request.setUserArgument(oldUserArgument);
-                request.setMaxIdleTime(oldMaxIdleTime);
+                session.setUser(oldUser);
+                session.setUserArgument(oldUserArgument);
+                session.setMaxIdleTime(oldMaxIdleTime);
                 
                 log.warn("Login failure - " + userName);
                 out.send(530, "PASS", userName);
@@ -200,7 +202,7 @@
             // update different objects
             FileSystemManager fmanager = serverContext.getFileSystemManager(); 
             FileSystemView fsview = fmanager.createFileSystemView(authenticatedUser);
-            request.setLogin(fsview);
+            session.setLogin(fsview);
             stat.setLogin(handler);
 
             // everything is fine - send login ok message
@@ -217,7 +219,7 @@
             
             // if login failed - reset user
             if(!success) {
-                request.reinitialize();
+                session.reinitialize();
             }
         }
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java Tue Jan  2 08:17:22 2007
@@ -23,10 +23,11 @@
 import java.net.InetAddress;
 
 import org.apache.ftpserver.FtpDataConnection;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>PASV &lt;CRLF&gt;</code><br>
@@ -46,14 +47,15 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // set data connection
-        FtpDataConnection dataCon = request.getFtpDataConnection();
+        FtpDataConnection dataCon = session.getFtpDataConnection();
         if (!dataCon.setPasvCommand()) {
             out.send(425, "PASV", null);
             return;   

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PBSZ.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PBSZ.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PBSZ.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PBSZ.java Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * Protection buffer size.
@@ -38,10 +39,11 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
-        request.resetState();
+        session.resetState();
         out.send(200, "PBSZ", null);
     }
 }

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -24,9 +24,10 @@
 import java.net.UnknownHostException;
 import java.util.StringTokenizer;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.interfaces.DataConnectionConfig;
 
 /**
@@ -56,11 +57,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // argument check
         if(!request.hasArgument()) {
@@ -96,7 +98,7 @@
         
         // check IP
         if(dataCfg.isActiveIpCheck()) {
-            InetAddress clientAddr = handler.getRequest().getRemoteAddress();
+            InetAddress clientAddr = session.getRemoteAddress();
             if(!dataAddr.equals(clientAddr)) {
                 out.send(510, "PORT.mismatch", null);
                 return;
@@ -116,7 +118,7 @@
             return; 
         }
         
-        request.getFtpDataConnection().setPortCommand(dataAddr, dataPort);
+        session.getFtpDataConnection().setPortCommand(dataAddr, dataPort);
         out.send(200, "PORT", null);
     }
     

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java Tue Jan  2 08:17:22 2007
@@ -22,10 +22,11 @@
 import java.io.IOException;
 
 import org.apache.ftpserver.FtpDataConnection;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 
 /**
@@ -40,11 +41,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
     
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // check argument
         String arg = request.getArgument();
@@ -55,7 +57,7 @@
         
         // check argument
         arg = arg.toUpperCase();
-        FtpDataConnection dcon = request.getFtpDataConnection();
+        FtpDataConnection dcon = session.getFtpDataConnection();
         if(arg.equals("C")) {
             dcon.setSecure(false);
             out.send(200, "PROT", null);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PWD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PWD.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PWD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PWD.java Tue Jan  2 08:17:22 2007
@@ -21,11 +21,12 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FileSystemView;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>PWD  &lt;CRLF&gt;</code><br>
@@ -42,10 +43,11 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
-        request.resetState();
-        FileSystemView fsview = request.getFileSystemView();
+        session.resetState();
+        FileSystemView fsview = session.getFileSystemView();
         String currDir = fsview.getCurrentDirectory().getFullName();
         out.send(257, "PWD", currDir);
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/QUIT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/QUIT.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/QUIT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/QUIT.java Tue Jan  2 08:17:22 2007
@@ -21,9 +21,10 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>QUIT &lt;CRLF&gt;</code><br>
@@ -40,9 +41,10 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
-        request.resetState();
+        session.resetState();
         out.send(221, "QUIT", null);
         handler.getServerContext().getConnectionManager().closeConnection(handler);
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REIN.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REIN.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REIN.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/REIN.java Tue Jan  2 08:17:22 2007
@@ -21,9 +21,10 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
   * <code>REIN &lt;CRLF&gt;</code><br>
@@ -40,11 +41,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
-        request.reinitialize();
-        request.setLanguage(null);
+        session.reinitialize();
+        session.setLanguage(null);
         out.send(220, "REIN", null);
     }   
 }

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -21,9 +21,10 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>REST &lt;SP&gt; <marker> &lt;CRLF&gt;</code><br>
@@ -44,7 +45,8 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
         // argument check
@@ -55,7 +57,7 @@
         }
         
         // get offset number
-        request.resetState();
+        session.resetState();
         long skipLen = 0L;
         try {
             skipLen = Long.parseLong(argument);
@@ -74,7 +76,7 @@
             out.send(501, "REST.invalid", null); 
         }
         
-        request.setFileOffset(skipLen);
+        session.setFileOffset(skipLen);
     } 
     
 }

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -27,13 +27,14 @@
 import java.net.SocketException;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.Authority;
 import org.apache.ftpserver.ftplet.DataType;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -59,13 +60,14 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         try {
         
             // get state variable
-            long skipLen = request.getFileOffset();
+            long skipLen = session.getFileOffset();
             FtpServerContext serverContext = handler.getServerContext();
             
             // argument check
@@ -79,7 +81,7 @@
             Ftplet ftpletContainer = serverContext.getFtpletContainer();
             FtpletEnum ftpletRet;
             try {
-                ftpletRet = ftpletContainer.onDownloadStart(request, out);
+                ftpletRet = ftpletContainer.onDownloadStart(session, request, out);
             } catch(Exception e) {
                 log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -95,7 +97,7 @@
             // get file object
             FileObject file = null;
             try {
-                file = request.getFileSystemView().getFileObject(fileName);
+                file = session.getFileSystemView().getFileObject(fileName);
             }
             catch(Exception ex) {
                 log.debug("Exception getting file object", ex);
@@ -128,7 +130,7 @@
             out.send(150, "RETR", null);
             OutputStream os = null;
             try {
-                os = request.getDataOutputStream();
+                os = session.getDataOutputStream();
             }
             catch(IOException ex) {
                 log.debug("Exception getting the output data stream", ex);
@@ -147,7 +149,7 @@
                 bos = IoUtils.getBufferedOutputStream(os);
                 
                 // transfer data
-                Authority[] maxDownloadRates = handler.getRequest().getUser().getAuthorities(TransferRatePermission.class);
+                Authority[] maxDownloadRates = session.getUser().getAuthorities(TransferRatePermission.class);
             
                 int maxRate = 0;
                 if(maxDownloadRates.length > 0) {
@@ -157,7 +159,7 @@
                 long transSz = handler.transfer(bis, bos, maxRate);
                 
                 // log message
-                String userName = request.getUser().getName();
+                String userName = session.getUser().getName();
                 Log log = serverContext.getLogFactory().getInstance(getClass());
                 log.info("File download : " + userName + " - " + fileName);
                 
@@ -186,7 +188,7 @@
                 
                 // call Ftplet.onDownloadEnd() method
                 try {
-                    ftpletRet = ftpletContainer.onDownloadEnd(request, out);
+                    ftpletRet = ftpletContainer.onDownloadEnd(session, request, out);
                 } catch(Exception e) {
                     log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -199,8 +201,8 @@
             }
         }
         finally {
-            request.resetState();
-            request.getFtpDataConnection().closeDataSocket();
+            session.resetState();
+            session.getFtpDataConnection().closeDataSocket();
         }
     }
     

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -22,11 +22,12 @@
 import java.io.IOException;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -50,11 +51,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         FtpServerContext serverContext = handler.getServerContext();
         
         // argument check
@@ -68,7 +70,7 @@
         Ftplet ftpletContainer = serverContext.getFtpletContainer();
         FtpletEnum ftpletRet;
         try{
-            ftpletRet = ftpletContainer.onRmdirStart(request, out);
+            ftpletRet = ftpletContainer.onRmdirStart(session, request, out);
         } catch(Exception e) {
             log.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -84,7 +86,7 @@
         // get file object
         FileObject file = null;
         try {
-            file = request.getFileSystemView().getFileObject(fileName);
+            file = session.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
             log.debug("Exception getting file object", ex);
@@ -112,7 +114,7 @@
             out.send(250, "RMD", fileName); 
             
             // write log message
-            String userName = request.getUser().getName();
+            String userName = session.getUser().getName();
             Log log = serverContext.getLogFactory().getInstance(getClass());
             log.info("Directory remove : " + userName + " - " + fileName);
             
@@ -122,7 +124,7 @@
             
             // call Ftplet.onRmdirEnd() method
             try{
-                ftpletRet = ftpletContainer.onRmdirEnd(request, out);
+                ftpletRet = ftpletContainer.onRmdirEnd(session, request, out);
             } catch(Exception e) {
                 log.debug("Ftplet container threw exception", e);
                 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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -21,11 +21,12 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>RNFR &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -43,11 +44,12 @@
      * Execute command
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state variable
-        request.resetState();
+        session.resetState();
         
         // argument check
         String fileName = request.getArgument();
@@ -59,7 +61,7 @@
         // get filename
         FileObject renFr = null;
         try {
-            renFr = request.getFileSystemView().getFileObject(fileName);
+            renFr = session.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
             log.debug("Exception getting file object", ex);
@@ -70,7 +72,7 @@
             out.send(550, "RNFR", fileName);
         }
         else {
-            request.setRenameFrom(renFr);
+            session.setRenameFrom(renFr);
             fileName = renFr.getFullName();
             out.send(350, "RNFR", fileName);    
         }

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -22,11 +22,12 @@
 import java.io.IOException;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -49,7 +50,8 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         try {
             
@@ -65,7 +67,7 @@
             Ftplet ftpletContainer = serverContext.getFtpletContainer();
             FtpletEnum ftpletRet;
             try {
-                ftpletRet = ftpletContainer.onRenameStart(request, out);
+                ftpletRet = ftpletContainer.onRenameStart(session, request, out);
             } catch(Exception e) {
                 log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -79,7 +81,7 @@
             }
             
             // get the "rename from" file object
-            FileObject frFile = request.getRenameFrom();
+            FileObject frFile = session.getRenameFrom();
             if( frFile == null ) {
                 out.send(503, "RNTO", null);
                 return;
@@ -88,7 +90,7 @@
             // get target file
             FileObject toFile = null;
             try {
-                toFile = request.getFileSystemView().getFileObject(toFileStr);
+                toFile = session.getFileSystemView().getFileObject(toFileStr);
             }
             catch(Exception ex) {
                 log.debug("Exception getting file object", ex);
@@ -116,12 +118,12 @@
                 out.send(250, "RNTO", toFileStr);
 
                 Log log = serverContext.getLogFactory().getInstance(getClass());
-                log.info("File rename (" + request.getUser().getName() + ") " 
+                log.info("File rename (" + session.getUser().getName() + ") " 
                                          + frFile.getFullName() + " -> " + toFile.getFullName());
                 
                 // call Ftplet.onRenameEnd() method
                 try {
-                    ftpletRet = ftpletContainer.onRenameEnd(request, out);
+                    ftpletRet = ftpletContainer.onRenameEnd(session, request, out);
                 } catch(Exception e) {
                     log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -137,7 +139,7 @@
         
         }
         finally {
-            request.resetState(); 
+            session.resetState(); 
         }
     } 
 

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -23,10 +23,11 @@
 import java.util.HashMap;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.Command;
@@ -48,7 +49,8 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // call Ftplet.onSite method
@@ -56,7 +58,7 @@
         Ftplet ftpletContainer = serverContext.getFtpletContainer();
         FtpletEnum ftpletRet;
         try {
-            ftpletRet = ftpletContainer.onSite(request, out);
+            ftpletRet = ftpletContainer.onSite(session, request, out);
         } catch(Exception e) {
             log.debug("Ftplet container threw exception", e);
             ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -81,7 +83,7 @@
         
         // no params
         if(argument == null) {
-            request.resetState();
+            session.resetState();
             out.send(200, "SITE", null);
             return;
         }
@@ -91,17 +93,17 @@
         Command command = (Command)COMMAND_MAP.get( siteRequest );
         try {
             if(command != null) {
-                command.execute(handler, request, out);
+                command.execute(handler, request, session, out);
             }
             else {
-                request.resetState();
+                session.resetState();
                 out.send(502, "SITE", argument);
             }
         }
         catch(Exception ex) {
             Log log = serverContext.getLogFactory().getInstance(getClass());
             log.warn("SITE.execute()", ex);
-            request.resetState();
+            session.resetState();
             out.send(500, "SITE", null);
         }
     

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_DESCUSER.java Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.User;
 import org.apache.ftpserver.ftplet.UserManager;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -43,15 +44,16 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request,
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
     
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // only administrator can execute this
         UserManager userManager = handler.getServerContext().getUserManager(); 
-        boolean isAdmin = userManager.isAdmin(request.getUser().getName());
+        boolean isAdmin = userManager.isAdmin(session.getUser().getName());
         if(!isAdmin) {
             out.send(530, "SITE", null);
             return;

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_HELP.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_HELP.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_HELP.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_HELP.java Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 
 /**
@@ -39,11 +40,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // print help message
         out.send(200, "SITE.HELP", null);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_STAT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_STAT.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_STAT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_STAT.java Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpStatistics;
 import org.apache.ftpserver.ftplet.UserManager;
 import org.apache.ftpserver.util.DateUtils;
@@ -41,15 +42,16 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-            FtpRequestImpl request, 
+            FtpRequest request,
+            FtpSessionImpl session, 
             FtpWriter out) throws IOException, FtpException {
     
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // only administrator can execute this
         UserManager userManager = handler.getServerContext().getUserManager(); 
-        boolean isAdmin = userManager.isAdmin(request.getUser().getName());
+        boolean isAdmin = userManager.isAdmin(session.getUser().getName());
         if(!isAdmin) {
             out.send(530, "SITE", null);
             return;

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_WHO.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_WHO.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_WHO.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_WHO.java Tue Jan  2 08:17:22 2007
@@ -23,11 +23,12 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.ftplet.User;
 import org.apache.ftpserver.ftplet.UserManager;
 import org.apache.ftpserver.interfaces.Connection;
@@ -47,15 +48,16 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // only administrator can execute this
         UserManager userManager = handler.getServerContext().getUserManager(); 
-        boolean isAdmin = userManager.isAdmin(request.getUser().getName());
+        boolean isAdmin = userManager.isAdmin(session.getUser().getName());
         if(!isAdmin) {
             out.send(530, "SITE", null);
             return;
@@ -68,7 +70,7 @@
         sb.append('\n');
         for(Iterator conIt = allCons.iterator(); conIt.hasNext(); ) {
             Connection tmpCon = (Connection)conIt.next();
-            FtpRequest tmpReq = tmpCon.getRequest();
+            FtpSession tmpReq = tmpCon.getSession();
             if(!tmpReq.isLoggedIn()) {
                 continue;
             }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_ZONE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_ZONE.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_ZONE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SITE_ZONE.java Tue Jan  2 08:17:22 2007
@@ -23,10 +23,11 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * Displays the FTP server timezone in RFC 822 format.
@@ -42,11 +43,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-            FtpRequestImpl request, 
+            FtpRequest request,
+            FtpSessionImpl session, 
             FtpWriter out) throws IOException, FtpException {
   
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // send timezone data
         String timezone = TIMEZONE_FMT.format(new Date());

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -21,11 +21,12 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>SIZE &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -41,11 +42,12 @@
      * Execute command.
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // argument check
         String fileName = request.getArgument();
@@ -57,7 +59,7 @@
         // get file object
         FileObject file = null;
         try {
-            file = request.getFileSystemView().getFileObject(fileName);
+            file = session.getFileSystemView().getFileObject(fileName);
         }
         catch(Exception ex) {
             log.debug("Exception getting file object", ex);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STAT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STAT.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STAT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STAT.java Tue Jan  2 08:17:22 2007
@@ -21,9 +21,10 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>STAT [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -40,11 +41,12 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // write the status info
         out.send(211, "STAT", null); 

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -26,12 +26,13 @@
 import java.net.SocketException;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.Authority;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -60,13 +61,14 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         try {
         
             // get state variable
-            long skipLen = request.getFileOffset();
+            long skipLen = session.getFileOffset();
             FtpServerContext serverContext = handler.getServerContext();
             
             // argument check
@@ -80,7 +82,7 @@
             Ftplet ftpletContainer = serverContext.getFtpletContainer();
             FtpletEnum ftpletRet;
             try {
-                ftpletRet = ftpletContainer.onUploadStart(request, out);
+                ftpletRet = ftpletContainer.onUploadStart(session, request, out);
             } catch(Exception e) {
                 log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -96,7 +98,7 @@
             // get filename
             FileObject file = null;
             try {
-                file = request.getFileSystemView().getFileObject(fileName);
+                file = session.getFileSystemView().getFileObject(fileName);
             }
             catch(Exception ex) {
                 log.debug("Exception getting file object", ex);
@@ -117,7 +119,7 @@
             out.send(150, "STOR", fileName);
             InputStream is = null;
             try {
-                is = request.getDataInputStream();
+                is = session.getDataInputStream();
             }
             catch(IOException ex) {
                 log.debug("Exception getting the input data stream", ex);
@@ -136,7 +138,7 @@
                 bos = IoUtils.getBufferedOutputStream( file.createOutputStream(skipLen) );
                 
                 // transfer data
-                Authority[] maxUploadRates = handler.getRequest().getUser().getAuthorities(TransferRatePermission.class);
+                Authority[] maxUploadRates = session.getUser().getAuthorities(TransferRatePermission.class);
             
                 int maxRate = 0;
                 if(maxUploadRates.length > 0) {
@@ -145,8 +147,7 @@
                 long transSz = handler.transfer(bis, bos, maxRate);
                 
                 // log message
-                String userName = request.getUser().getName();
-                Log log = serverContext.getLogFactory().getInstance(getClass());
+                String userName = session.getUser().getName();
                 log.info("File upload : " + userName + " - " + fileName);
                 
                 // notify the statistics component
@@ -174,7 +175,7 @@
                 
                 // call Ftplet.onUploadEnd() method
                 try {
-                    ftpletRet = ftpletContainer.onUploadEnd(request, out);
+                    ftpletRet = ftpletContainer.onUploadEnd(session, request, out);
                 } catch(Exception e) {
                     log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -187,8 +188,8 @@
             }
         }
         finally {
-            request.resetState();
-            request.getFtpDataConnection().closeDataSocket();
+            session.resetState();
+            session.getFtpDataConnection().closeDataSocket();
         }
     }
 }

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -26,13 +26,15 @@
 import java.net.SocketException;
 
 import org.apache.commons.logging.Log;
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.Authority;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FileSystemView;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -58,20 +60,21 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
         
         try {
         
             // reset state variables
-            request.resetState();
+            session.resetState();
             FtpServerContext serverContext = handler.getServerContext();
             
             // call Ftplet.onUploadUniqueStart() method
             Ftplet ftpletContainer = serverContext.getFtpletContainer();
             FtpletEnum ftpletRet;
             try {
-                ftpletRet = ftpletContainer.onUploadUniqueStart(request, out);
+                ftpletRet = ftpletContainer.onUploadUniqueStart(session, request, out);
             } catch(Exception e) {
                 log.debug("Ftplet container threw exception", e);
                 ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -96,9 +99,9 @@
             // get filenames
             FileObject file = null;
             try {
-                file = request.getFileSystemView().getFileObject(filePrefix);
+                file = session.getFileSystemView().getFileObject(filePrefix);
                 if(file != null) {
-                    file = getUniqueFile(handler, file);
+                    file = getUniqueFile(handler, session, file);
                 }
             }
             catch(Exception ex) {
@@ -120,7 +123,7 @@
             out.send(150, "STOU", null);
             InputStream is = null;
             try {
-                is = request.getDataInputStream();
+                is = session.getDataInputStream();
             }
             catch(IOException ex) {
                 log.debug("Exception getting the input data stream", ex);
@@ -140,7 +143,7 @@
                 bos = IoUtils.getBufferedOutputStream( file.createOutputStream(0L) );
 
                 // transfer data
-                Authority[] maxUploadRates = handler.getRequest().getUser().getAuthorities(TransferRatePermission.class);
+                Authority[] maxUploadRates = session.getUser().getAuthorities(TransferRatePermission.class);
                 
                 int maxRate = 0;
                 if(maxUploadRates.length > 0) {
@@ -149,8 +152,7 @@
                 long transSz = handler.transfer(bis, bos, maxRate);
                 
                 // log message
-                String userName = request.getUser().getName();
-                Log log = serverContext.getLogFactory().getInstance(getClass());
+                String userName = session.getUser().getName();
                 log.info("File upload : " + userName + " - " + fileName);
                 
                 // notify the statistics component
@@ -180,7 +182,7 @@
                 
                 // call Ftplet.onUploadUniqueEnd() method
                 try {
-                    ftpletRet = ftpletContainer.onUploadUniqueEnd(request, out);
+                    ftpletRet = ftpletContainer.onUploadUniqueEnd(session, request, out);
                 } catch(Exception e) {
                     log.debug("Ftplet container threw exception", e);
                     ftpletRet = FtpletEnum.RET_DISCONNECT;
@@ -193,7 +195,7 @@
             }
         }
         finally {
-            request.getFtpDataConnection().closeDataSocket();
+            session.getFtpDataConnection().closeDataSocket();
         }
         
     }
@@ -201,9 +203,9 @@
     /**
      * Get unique file object.
      */
-    protected FileObject getUniqueFile(RequestHandler handler, FileObject oldFile) throws FtpException {
+    protected FileObject getUniqueFile(RequestHandler handler, FtpSession session, FileObject oldFile) throws FtpException {
         FileObject newFile = oldFile;
-        FileSystemView fsView = handler.getRequest().getFileSystemView();
+        FileSystemView fsView = session.getFileSystemView();
         String fileName = newFile.getFullName();
         while( newFile.doesExist() ) {
             newFile = fsView.getFileObject(fileName + '.' + System.currentTimeMillis());

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -21,9 +21,10 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.Structure;
 
 /**
@@ -41,11 +42,12 @@
      * Execute command
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // argument check
         if(!request.hasArgument()) {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SYST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SYST.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SYST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/SYST.java Tue Jan  2 08:17:22 2007
@@ -21,9 +21,10 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>SYST &lt;CRLF&gt;</code><br> 
@@ -41,11 +42,12 @@
      * Execute command
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // get server system info 
         String systemName = System.getProperty("os.name");

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=491831&r1=491830&r2=491831
==============================================================================
--- 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 Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.DataType;
+import org.apache.ftpserver.ftplet.FtpRequest;
 
 /**
  * <code>TYPE &lt;SP&gt; &lt;type-code&gt; &lt;CRLF&gt;</code><br>
@@ -40,11 +41,12 @@
      * Execute command
      */
     public void execute(RequestHandler handler,
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         
         // reset state variables
-        request.resetState();
+        session.resetState();
         
         // get type from argument
         char type = 'A';

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/USER.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/USER.java?view=diff&rev=491831&r1=491830&r2=491831
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/USER.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/USER.java Tue Jan  2 08:17:22 2007
@@ -21,10 +21,11 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpRequestImpl;
+import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.RequestHandler;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.User;
 import org.apache.ftpserver.interfaces.ConnectionManager;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -50,7 +51,8 @@
      * Execute command.
      */
     public void execute(RequestHandler handler, 
-                        FtpRequestImpl request, 
+                        FtpRequest request,
+                        FtpSessionImpl session, 
                         FtpWriter out) throws IOException, FtpException {
     
         boolean success = false;
@@ -60,7 +62,7 @@
         try {
             
             // reset state variables
-            request.resetState();
+            session.resetState();
             
             // argument check
             String userName = request.getArgument();
@@ -70,8 +72,8 @@
             }
             
             // already logged-in
-            BaseUser user = (BaseUser)request.getUser();
-            if(request.isLoggedIn()) {
+            BaseUser user = (BaseUser)session.getUser();
+            if(session.isLoggedIn()) {
                 if( userName.equals(user.getName()) ) {
                     out.send(230, "USER", null);
                     success = true;
@@ -111,7 +113,7 @@
                 
                 ConcurrentLoginRequest loginRequest = new  ConcurrentLoginRequest(
                         stat.getCurrentUserLoginNumber(configUser) + 1,
-                        stat.getCurrentUserLoginNumber(configUser, request.getRemoteAddress()) + 1);
+                        stat.getCurrentUserLoginNumber(configUser, session.getRemoteAddress()) + 1);
                 
                 if(!configUser.authorize(loginRequest)) {
                     out.send(421, "USER.login", null);
@@ -121,7 +123,7 @@
             
             // finally set the user name
             success = true;
-            request.setUserArgument(userName);
+            session.setUserArgument(userName);
             if(anonymous) {
                 out.send(331, "USER.anonymous", userName);
             }



Mime
View raw message