incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r498472 [2/2] - in /incubator/ftpserver/trunk: core/src/java/org/apache/ftpserver/ core/src/java/org/apache/ftpserver/command/ core/src/java/org/apache/ftpserver/interfaces/ core/src/java/org/apache/ftpserver/listener/ core/src/java/org/apa...
Date Sun, 21 Jan 2007 22:43:54 GMT
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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -29,6 +29,7 @@
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * Data channel protection level.
@@ -52,7 +53,7 @@
         // check argument
         String arg = request.getArgument();
         if(arg == null) {
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "PROT", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "PROT", null));
             return;
         }
         
@@ -61,20 +62,20 @@
         FtpDataConnectionFactory dcon = session.getFtpDataConnection();
         if(arg.equals("C")) {
             dcon.setSecure(false);
-            out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "PROT", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_200_COMMAND_OKAY, "PROT", null));
         }
         else if(arg.equals("P")) {
             FtpServerContext serverContext = connection.getServerContext();
             if(serverContext.getDataConnectionConfig().getSSL() == null) {
-                out.send(431, "PROT", null);
+                out.write(FtpReplyUtil.translate(session, 431, "PROT", null));
             }
             else {
                 dcon.setSecure(true);
-                out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "PROT", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_200_COMMAND_OKAY, "PROT", null));
             }
         }
         else {
-            out.send(FtpResponse.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "PROT", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -28,6 +28,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>PWD  &lt;CRLF&gt;</code><br>
@@ -50,7 +51,7 @@
         session.resetState();
         FileSystemView fsview = session.getFileSystemView();
         String currDir = fsview.getCurrentDirectory().getFullName();
-        out.send(FtpResponse.REPLY_257_PATHNAME_CREATED, "PWD", currDir);
+        out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_257_PATHNAME_CREATED, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -26,6 +26,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>QUIT &lt;CRLF&gt;</code><br>
@@ -46,7 +47,7 @@
                         FtpSessionImpl session, 
                         FtpWriter out) throws IOException {
         session.resetState();
-        out.send(FtpResponse.REPLY_221_CLOSING_CONTROL_CONNECTION, "QUIT", null);
+        out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_221_CLOSING_CONTROL_CONNECTION, "QUIT", null));
         connection.getServerContext().getConnectionManager().closeConnection(connection);
     }
 

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -26,6 +26,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
   * <code>REIN &lt;CRLF&gt;</code><br>
@@ -48,6 +49,6 @@
         
         session.reinitialize();
         session.setLanguage(null);
-        out.send(FtpResponse.REPLY_220_SERVICE_READY, "REIN", null);
+        out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_220_SERVICE_READY, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -26,6 +26,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>REST &lt;SP&gt; <marker> &lt;CRLF&gt;</code><br>
@@ -53,7 +54,7 @@
         // argument check
         String argument = request.getArgument();
         if(argument == null) {
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "REST", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "REST", null));
             return;  
         }
         
@@ -66,15 +67,15 @@
             // check offset number
             if(skipLen < 0L) {
                 skipLen = 0L;
-                out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "REST.negetive", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "REST.negetive", null));
             }
             else {
-                out.send(FtpResponse.REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION, "REST", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION, "REST", null));
             }
         }
         catch(NumberFormatException ex) {
             log.debug("Invalid restart position: " + argument, ex);
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "REST.invalid", null); 
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "REST.invalid", null)); 
         }
         
         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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -24,7 +24,6 @@
 import java.io.InputStream;
 import java.net.SocketException;
 
-import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
@@ -38,6 +37,7 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 import org.apache.ftpserver.util.IoUtils;
 
 /**
@@ -71,7 +71,7 @@
             // argument check
             String fileName = request.getArgument();
             if(fileName == null) {
-                out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RETR", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RETR", null));
                 return;  
             }
     
@@ -101,31 +101,31 @@
                 log.debug("Exception getting file object", ex);
             }
             if(file == null) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.missing", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.missing", fileName));
                 return;
             }
             fileName = file.getFullName();
             
             // check file existance
             if(!file.doesExist()) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.missing", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.missing", fileName));
                 return;
             }
             
             // check valid file
             if(!file.isFile()) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.invalid", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.invalid", fileName));
                 return;
             }
             
             // check permission
             if(!file.hasReadPermission()) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.permission", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RETR.permission", fileName));
                 return;
             }
             
             // get data connection
-            out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "RETR", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_150_FILE_STATUS_OKAY, "RETR", null));
 
             
             // send file data to client
@@ -137,7 +137,7 @@
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
                 log.debug("Exception getting the output data stream", e);
-                out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "RETR", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "RETR", null));
                 return;
             }
             
@@ -162,12 +162,12 @@
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
                 failure = true;
-                out.send(FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "RETR", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "RETR", fileName));
             }
             catch(IOException ex) {
                 log.debug("IOException during data transfer", ex);
                 failure = true;
-                out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "RETR", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "RETR", fileName));
             }
             finally {
                 IoUtils.close(is);
@@ -175,7 +175,7 @@
             
             // if data transfer ok - send transfer complete message
             if(!failure) {
-                out.send(FtpResponse.REPLY_226_CLOSING_DATA_CONNECTION, "RETR", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_226_CLOSING_DATA_CONNECTION, "RETR", fileName));
                 
                 // call Ftplet.onDownloadEnd() method
                 try {

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -33,6 +33,7 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>RMD  &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -63,7 +64,7 @@
         // argument check
         String fileName = request.getArgument();
         if(fileName == null) {
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RMD", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RMD", null));
             return;  
         }
         
@@ -93,26 +94,26 @@
             log.debug("Exception getting file object", ex);
         }
         if(file == null) {
-            out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RMD.permission", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RMD.permission", fileName));
             return;
         }
         
         // check permission
         fileName = file.getFullName();
         if( !file.hasDeletePermission() ) {
-            out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RMD.permission", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RMD.permission", fileName));
             return;
         }
         
         // check file
         if(!file.isDirectory()) {
-            out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RMD.invalid", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RMD.invalid", fileName));
             return;
         }
         
         // now delete directory
         if(file.delete()) {
-            out.send(FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "RMD", fileName); 
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "RMD", fileName)); 
             
             // write log message
             String userName = session.getUser().getName();
@@ -137,7 +138,7 @@
 
         }
         else {
-            out.send(FtpResponse.REPLY_450_REQUESTED_FILE_ACTION_NOT_TAKEN, "RMD", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_450_REQUESTED_FILE_ACTION_NOT_TAKEN, "RMD", fileName));
         }
     }
 }

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -28,6 +28,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>RNFR &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -55,7 +56,7 @@
         // argument check
         String fileName = request.getArgument();
         if(fileName == null) {
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RNFR", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RNFR", null));
             return;  
         }
                 
@@ -70,12 +71,12 @@
             
         // check file
         if(renFr == null) {
-            out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RNFR", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "RNFR", fileName));
         }
         else {
             session.setRenameFrom(renFr);
             fileName = renFr.getFullName();
-            out.send(FtpResponse.REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION, "RNFR", fileName);    
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -32,6 +32,7 @@
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>RNTO &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -59,7 +60,7 @@
             // argument check
             String toFileStr = request.getArgument();
             if(toFileStr == null) {
-                out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RNTO", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "RNTO", null));
                 return;  
             }
             
@@ -84,7 +85,7 @@
             // get the "rename from" file object
             FileObject frFile = session.getRenameFrom();
             if( frFile == null ) {
-                out.send(FtpResponse.REPLY_503_BAD_SEQUENCE_OF_COMMANDS, "RNTO", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_503_BAD_SEQUENCE_OF_COMMANDS, "RNTO", null));
                 return;
             }
             
@@ -97,26 +98,26 @@
                 log.debug("Exception getting file object", ex);
             }
             if(toFile == null) {
-                out.send(FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO.invalid", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO.invalid", null));
                 return;
             }
             toFileStr = toFile.getFullName();
             
             // check permission
             if( !toFile.hasWritePermission() ) {
-                out.send(FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO.permission", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO.permission", null));
                 return;
             }
             
             // check file existance
             if( !frFile.doesExist() ) {
-                out.send(FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO.missing", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO.missing", null));
                 return;
             }
             
             // now rename
             if( frFile.move(toFile) ) { 
-                out.send(FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "RNTO", toFileStr);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "RNTO", toFileStr));
 
                 Log log = serverContext.getLogFactory().getInstance(getClass());
                 log.info("File rename (" + session.getUser().getName() + ") " 
@@ -135,7 +136,7 @@
                 }
             }
             else {
-                out.send(FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO", toFileStr);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED, "RNTO", toFileStr));
             }
         
         }

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -33,6 +33,7 @@
 import org.apache.ftpserver.interfaces.Command;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 
 /**
@@ -85,7 +86,7 @@
         // no params
         if(argument == null) {
             session.resetState();
-            out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "SITE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_200_COMMAND_OKAY, "SITE", null));
             return;
         }
         
@@ -98,14 +99,14 @@
             }
             else {
                 session.resetState();
-                out.send(FtpResponse.REPLY_502_COMMAND_NOT_IMPLEMENTED, "SITE", argument);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_502_COMMAND_NOT_IMPLEMENTED, "SITE", argument));
             }
         }
         catch(Exception ex) {
             Log log = serverContext.getLogFactory().getInstance(getClass());
             log.warn("SITE.execute()", ex);
             session.resetState();
-            out.send(FtpResponse.REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED, "SITE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -33,6 +33,7 @@
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.usermanager.TransferRateRequest;
 import org.apache.ftpserver.usermanager.WriteRequest;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * This SITE command returns the specified user information.
@@ -57,7 +58,7 @@
         UserManager userManager = connection.getServerContext().getUserManager(); 
         boolean isAdmin = userManager.isAdmin(session.getUser().getName());
         if(!isAdmin) {
-            out.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "SITE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_530_NOT_LOGGED_IN, "SITE", null));
             return;
         }
         
@@ -65,7 +66,7 @@
         String argument = request.getArgument();
         int spIndex = argument.indexOf(' ');
         if(spIndex == -1) {
-            out.send(FtpResponse.REPLY_503_BAD_SEQUENCE_OF_COMMANDS, "SITE.DESCUSER", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_503_BAD_SEQUENCE_OF_COMMANDS, "SITE.DESCUSER", null));
             return;
         }
         String userName = argument.substring(spIndex + 1);
@@ -84,7 +85,7 @@
             user = null;
         }
         if(user == null) {
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "SITE.DESCUSER", userName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "SITE.DESCUSER", userName));
             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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -27,6 +27,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 
 /**
@@ -49,7 +50,7 @@
         session.resetState();
         
         // print help message
-        out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "SITE.HELP", null);
+        out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_200_COMMAND_OKAY, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -31,6 +31,7 @@
 import org.apache.ftpserver.ftplet.UserManager;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.DateUtils;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * Show all statistics information.
@@ -55,7 +56,7 @@
         UserManager userManager = connection.getServerContext().getUserManager(); 
         boolean isAdmin = userManager.isAdmin(session.getUser().getName());
         if(!isAdmin) {
-            out.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "SITE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_530_NOT_LOGGED_IN, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -34,6 +34,7 @@
 import org.apache.ftpserver.ftplet.UserManager;
 import org.apache.ftpserver.listener.Connection;
 import org.apache.ftpserver.util.DateUtils;
+import org.apache.ftpserver.util.FtpReplyUtil;
 import org.apache.ftpserver.util.StringUtils;
 
 
@@ -60,7 +61,7 @@
         UserManager userManager = connection.getServerContext().getUserManager(); 
         boolean isAdmin = userManager.isAdmin(session.getUser().getName());
         if(!isAdmin) {
-            out.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "SITE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_530_NOT_LOGGED_IN, "SITE", null));
             return;
         }
         

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -28,6 +28,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>SIZE &lt;SP&gt; &lt;pathname&gt; &lt;CRLF&gt;</code><br>
@@ -53,7 +54,7 @@
         // argument check
         String fileName = request.getArgument();
         if(fileName == null) {
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "SIZE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "SIZE", null));
             return;  
         }
         
@@ -66,21 +67,21 @@
             log.debug("Exception getting file object", ex);
         }
         if(file == null) {
-            out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "SIZE.missing", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "SIZE.missing", fileName));
             return;
         }
         
         // print file size
         fileName = file.getFullName();
         if(!file.doesExist()) {
-            out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "SIZE.missing", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "SIZE.missing", fileName));
         }
         else if(!file.isFile()) {
-            out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "SIZE.invalid", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "SIZE.invalid", fileName));
         }
         else {
             String fileLen = String.valueOf(file.getSize());             
-            out.send(FtpResponse.REPLY_213_FILE_STATUS, "SIZE", fileLen);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_213_FILE_STATUS, "SIZE", fileLen));
         }
     } 
 

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -26,6 +26,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>STAT [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -50,7 +51,7 @@
         session.resetState();
         
         // write the status info
-        out.send(FtpResponse.REPLY_211_SYSTEM_STATUS_REPLY, "STAT", null); 
+        out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_211_SYSTEM_STATUS_REPLY, "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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -35,6 +35,7 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 import org.apache.ftpserver.util.IoUtils;
 
 /**
@@ -71,7 +72,7 @@
             // argument check
             String fileName = request.getArgument();
             if(fileName == null) {
-                out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "STOR", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "STOR", null));
                 return;  
             }
             
@@ -101,26 +102,26 @@
                 log.debug("Exception getting file object", ex);
             }
             if(file == null) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOR.invalid", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOR.invalid", fileName));
                 return;
             }
             fileName = file.getFullName();
             
             // get permission
             if( !file.hasWritePermission() ) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOR.permission", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOR.permission", fileName));
                 return;
             }
             
             // get data connection
-            out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOR", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOR", fileName));
             
             FtpDataConnection dataConnection;
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
                 log.debug("Exception getting the input data stream", e);
-                out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOR", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOR", fileName));
                 return;
             }
             
@@ -142,12 +143,12 @@
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
                 failure = true;
-                out.send(FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "STOR", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "STOR", fileName));
             }
             catch(IOException ex) {
                 log.debug("IOException during data transfer", ex);
                 failure = true;
-                out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOR", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOR", fileName));
             }
             finally {
                 IoUtils.close(outStream);
@@ -155,7 +156,7 @@
             
             // if data transfer ok - send transfer complete message
             if(!failure) {
-                out.send(FtpResponse.REPLY_226_CLOSING_DATA_CONNECTION, "STOR", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_226_CLOSING_DATA_CONNECTION, "STOR", fileName));
                 
                 // call Ftplet.onUploadEnd() method
                 try {

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -37,6 +37,7 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 import org.apache.ftpserver.util.IoUtils;
 
 /**
@@ -105,31 +106,31 @@
                 log.debug("Exception getting file object", ex);
             }
             if(file == null) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOU", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOU", null));
                 return;
             }
             String fileName = file.getFullName();
             
             // check permission
             if(!file.hasWritePermission()) {
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOU.permission", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOU.permission", fileName));
                 return;
             }
             
             // get data connection
-            out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOU", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOU", null));
             
             // get data from client
             boolean failure = false;
             OutputStream os = null;
-            out.send(FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "STOU", fileName);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "STOU", fileName));
             
             FtpDataConnection dataConnection;
             try {
                 dataConnection = session.getFtpDataConnection().openConnection();
             } catch (Exception e) {
                 log.debug("Exception getting the input data stream", e);
-                out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOU", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOU", fileName));
                 return;
             }
             
@@ -154,12 +155,12 @@
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
                 failure = true;
-                out.send(FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "STOU", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "STOU", fileName));
             }
             catch(IOException ex) {
                 log.debug("IOException during data transfer", ex);
                 failure = true;
-                out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOU", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOU", fileName));
             }
             finally {
                 IoUtils.close(os);
@@ -167,7 +168,7 @@
             
             // if data transfer ok - send transfer complete message
             if(!failure) {
-                out.send(FtpResponse.REPLY_226_CLOSING_DATA_CONNECTION, "STOU", fileName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_226_CLOSING_DATA_CONNECTION, "STOU", fileName));
                 
                 // call Ftplet.onUploadUniqueEnd() method
                 try {

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -27,6 +27,7 @@
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.ftplet.Structure;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>STRU &lt;SP&gt; &lt;structure-code&gt; &lt;CRLF&gt;</code><br>
@@ -52,7 +53,7 @@
         
         // argument check
         if(!request.hasArgument()) {
-            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "STRU", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "STRU", null));
             return;  
         }
         
@@ -60,11 +61,11 @@
         char stru = request.getArgument().charAt(0);
         try  {
             session.setStructure(Structure.parseArgument(stru));
-            out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "STRU", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_200_COMMAND_OKAY, "STRU", null));
         } 
         catch(IllegalArgumentException e) {
             log.debug("Illegal structure argument: " + request.getArgument(), e);
-            out.send(FtpResponse.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "STRU", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "STRU", null));
         }
     }
 

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -26,6 +26,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>SYST &lt;CRLF&gt;</code><br> 
@@ -60,7 +61,7 @@
             systemName = systemName.replace(' ', '-');
         }
         // print server system info
-        out.send(FtpResponse.REPLY_215_NAME_SYSTEM_TYPE, "SYST", systemName);
+        out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_215_NAME_SYSTEM_TYPE, "SYST", systemName));
     }
 
 }

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -27,6 +27,7 @@
 import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>TYPE &lt;SP&gt; &lt;type-code&gt; &lt;CRLF&gt;</code><br>
@@ -58,11 +59,11 @@
         // set type
         try {
             session.setDataType(DataType.parseArgument(type));
-            out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "TYPE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_200_COMMAND_OKAY, "TYPE", null));
         } 
         catch(IllegalArgumentException e) {
             log.debug("Illegal type argument: " + request.getArgument(), e);
-            out.send(FtpResponse.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "TYPE", null);
+            out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "TYPE", null));
         }
     }
     

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=498472&r1=498471&r2=498472
==============================================================================
--- 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 Sun Jan 21 14:43:52 2007
@@ -33,6 +33,7 @@
 import org.apache.ftpserver.listener.ConnectionManager;
 import org.apache.ftpserver.usermanager.BaseUser;
 import org.apache.ftpserver.usermanager.ConcurrentLoginRequest;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 /**
  * <code>USER &lt;SP&gt; &lt;username&gt; &lt;CRLF&gt;</code><br>
@@ -68,7 +69,7 @@
             // argument check
             String userName = request.getArgument();
             if(userName == null) {
-                out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "USER", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "USER", null));
                 return;  
             }
             
@@ -76,11 +77,11 @@
             BaseUser user = (BaseUser)session.getUser();
             if(session.isLoggedIn()) {
                 if( userName.equals(user.getName()) ) {
-                    out.send(FtpResponse.REPLY_230_USER_LOGGED_IN, "USER", null);
+                    out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_230_USER_LOGGED_IN, "USER", null));
                     success = true;
                 }
                 else {
-                    out.send(530, "USER.invalid", null);
+                    out.write(FtpReplyUtil.translate(session, 530, "USER.invalid", null));
                 }
                 return;
             }
@@ -88,7 +89,7 @@
             // anonymous login is not enabled
             boolean anonymous = userName.equals("anonymous");
             if( anonymous && (!conManager.isAnonymousLoginEnabled()) ) {
-                out.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "USER.anonymous", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_530_NOT_LOGGED_IN, "USER.anonymous", null));
                 return;
             }
             
@@ -96,7 +97,7 @@
             int currAnonLogin = stat.getCurrentAnonymousLoginNumber();
             int maxAnonLogin = conManager.getMaxAnonymousLogins();
             if( anonymous && (currAnonLogin >= maxAnonLogin) ) {
-                out.send(FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.anonymous", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.anonymous", null));
                 return;
             }
             
@@ -104,7 +105,7 @@
             int currLogin = stat.getCurrentLoginNumber();
             int maxLogin = conManager.getMaxLogins();
             if(maxLogin != 0 && currLogin >= maxLogin) {
-                out.send(FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.login", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.login", null));
                 return;
             }
             
@@ -117,7 +118,7 @@
                         stat.getCurrentUserLoginNumber(configUser, session.getClientAddress()) + 1);
                 
                 if(configUser.authorize(loginRequest) == null) {
-                    out.send(FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.login", null);
+                    out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.login", null));
                     return;
                 }
             }
@@ -126,10 +127,10 @@
             success = true;
             session.setUserArgument(userName);
             if(anonymous) {
-                out.send(FtpResponse.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD, "USER.anonymous", userName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD, "USER.anonymous", userName));
             }
             else {
-                out.send(FtpResponse.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD, "USER", userName);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD, "USER", userName));
             }
         }
         finally {

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerContext.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerContext.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerContext.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerContext.java Sun Jan 21 14:43:52 2007
@@ -19,8 +19,8 @@
 
 package org.apache.ftpserver.interfaces;
 
-import org.apache.ftpserver.ftplet.FtpletContext;
 import org.apache.ftpserver.ftplet.Ftplet;
+import org.apache.ftpserver.ftplet.FtpletContext;
 import org.apache.ftpserver.listener.ConnectionManager;
 
 /**

Added: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerSession.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerSession.java?view=auto&rev=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerSession.java (added)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerSession.java Sun Jan 21 14:43:52 2007
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */  
+
+package org.apache.ftpserver.interfaces;
+
+import org.apache.ftpserver.ftplet.FtpSession;
+
+/**
+ * The user session as seen by server components, adds additional
+ * methods compared to the more limited FtpLet session
+ */
+public interface FtpServerSession extends FtpSession {
+
+    /**
+     * Retrive the server context
+     * @return The server context
+     */
+    FtpServerContext getServerContext();
+    
+}

Propchange: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/interfaces/FtpServerSession.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/FtpProtocolHandler.java Sun Jan 21 14:43:52 2007
@@ -38,6 +38,7 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.IpRestrictor;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
+import org.apache.ftpserver.util.FtpReplyUtil;
 
 public class FtpProtocolHandler {
     
@@ -88,7 +89,7 @@
             IpRestrictor ipRestrictor = serverContext.getIpRestrictor();
             if( !ipRestrictor.hasPermission(clientAddr) ) {
                 log.warn("No permission to access from " + hostAddress);
-                writer.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "ip.restricted", null);
+                writer.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_530_NOT_LOGGED_IN, "ip.restricted", null));
                 return;
             }
             
@@ -97,12 +98,12 @@
             
             if(maxConnections != 0 && ftpStat.getCurrentConnectionNumber() > maxConnections) {
                 log.warn("Maximum connection limit reached.");
-                writer.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "connection.limit", null);
+                writer.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_530_NOT_LOGGED_IN, "connection.limit", null));
                 return;
             }
             
             // everything is fine - go ahead 
-            writer.send(FtpResponse.REPLY_220_SERVICE_READY, null, null);
+            writer.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_220_SERVICE_READY, null, null));
         }
     }
     
@@ -110,7 +111,7 @@
         session.setCurrentRequest(request);
         
         if(!hasPermission(session, request)) {
-            writer.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "permission", null);
+            writer.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_530_NOT_LOGGED_IN, "permission", null));
             return;
         }
 
@@ -182,14 +183,14 @@
                 command.execute(connection, request, session, out);
             }
             else {
-                out.send(FtpResponse.REPLY_502_COMMAND_NOT_IMPLEMENTED, "not.implemented", null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_502_COMMAND_NOT_IMPLEMENTED, "not.implemented", null));
             }
         }
         catch(Exception ex) {
             
             // send error reply
             try { 
-                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, null, null);
+                out.write(FtpReplyUtil.translate(session, FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, null, null));
             }
             catch(Exception ex1) {
             }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java Sun Jan 21 14:43:52 2007
@@ -72,8 +72,9 @@
         // data connection object
         
         // reader object
-        ftpSession = new FtpSessionImpl();
+        ftpSession = new FtpSessionImpl(serverContext);
         ftpSession.setClientAddress(this.controlSocket.getInetAddress());
+        ftpSession.setServerAddress(this.controlSocket.getLocalAddress());
 
         FtpDataConnectionFactory dataCon = new FtpDataConnectionFactory(this.serverContext, ftpSession);
         dataCon.setServerControlAddress(controlSocket.getLocalAddress());
@@ -91,10 +92,7 @@
         }
         
         // writer object
-        writer = new IOFtpResponseOutput();
-        writer.setControlSocket(this.controlSocket);
-        writer.setServerContext(this.serverContext);
-        writer.setFtpSession(ftpSession);
+        writer = new IOFtpResponseOutput(this.controlSocket);
     }
     
     /**

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOFtpResponseOutput.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOFtpResponseOutput.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOFtpResponseOutput.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOFtpResponseOutput.java Sun Jan 21 14:43:52 2007
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
-import java.net.InetAddress;
 import java.net.Socket;
 
 import org.apache.ftpserver.FtpWriter;
@@ -32,7 +31,12 @@
 public class IOFtpResponseOutput extends FtpWriter {
 
     private Writer writer;
-    private InetAddress serverAddress;
+
+    public IOFtpResponseOutput(Socket controlSocket) throws IOException {
+        if(controlSocket != null) {
+            writer = new OutputStreamWriter(controlSocket.getOutputStream(), "UTF-8");
+        }
+    }
 
     public void write(FtpResponse response) throws IOException {
 
@@ -47,7 +51,6 @@
      * Set the control socket.
      */
     public void setControlSocket(Socket soc) throws IOException {
-        serverAddress = soc.getLocalAddress();
         writer = new OutputStreamWriter(soc.getOutputStream(), "UTF-8");
     }
         
@@ -57,10 +60,4 @@
     public void close() {
         IoUtils.close(writer);
     }
-
-    protected InetAddress getFallbackServerAddress() {
-        return serverAddress;
-    }
-
-    
 }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java Sun Jan 21 14:43:52 2007
@@ -47,8 +47,9 @@
         // data connection object
         
         // reader object
-        ftpSession = new FtpSessionImpl();
+        ftpSession = new FtpSessionImpl(serverContext);
         ftpSession.setClientAddress(((InetSocketAddress)session.getRemoteAddress()).getAddress());
+        ftpSession.setServerAddress(((InetSocketAddress)session.getLocalAddress()).getAddress());
 
         FtpDataConnectionFactory dataCon = new FtpDataConnectionFactory(this.serverContext, ftpSession);
         dataCon.setServerControlAddress(((InetSocketAddress)session.getLocalAddress()).getAddress());

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaFtpProtocolHandler.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaFtpProtocolHandler.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaFtpProtocolHandler.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaFtpProtocolHandler.java Sun Jan 21 14:43:52 2007
@@ -54,8 +54,6 @@
         session.setAttribute(CONNECTION_KEY, connection);
         
         MinaFtpResponseOutput output = new MinaFtpResponseOutput(session);
-        output.setServerContext(serverContext);
-        output.setFtpSession(connection.getSession());
         
         session.setAttribute(OUTPUT_KEY, output);
     }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/SSLFtpSocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/SSLFtpSocketFactory.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/SSLFtpSocketFactory.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/socketfactory/SSLFtpSocketFactory.java Sun Jan 21 14:43:52 2007
@@ -19,11 +19,11 @@
 
 package org.apache.ftpserver.socketfactory;
 
-import org.apache.ftpserver.ftplet.Configuration;
-import org.apache.ftpserver.ftplet.FtpException;
-
 import java.net.InetAddress;
 import java.net.ServerSocket;
+
+import org.apache.ftpserver.ftplet.Configuration;
+import org.apache.ftpserver.ftplet.FtpException;
 
 
 /**

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/command/AbstractCommandTestTemplate.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/command/AbstractCommandTestTemplate.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/command/AbstractCommandTestTemplate.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/command/AbstractCommandTestTemplate.java Sun Jan 21 14:43:52 2007
@@ -19,7 +19,9 @@
 
 package org.apache.ftpserver.command;
 
-import java.io.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.Socket;
 import java.net.SocketTimeoutException;
 

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/filesystem/NativeFileObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/filesystem/NativeFileObjectTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/filesystem/NativeFileObjectTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/filesystem/NativeFileObjectTest.java Sun Jan 21 14:43:52 2007
@@ -22,11 +22,11 @@
 import java.io.File;
 import java.io.IOException;
 
+import junit.framework.TestCase;
+
 import org.apache.ftpserver.ftplet.AuthorizationRequest;
 import org.apache.ftpserver.usermanager.BaseUser;
 import org.apache.ftpserver.util.IoUtils;
-
-import junit.framework.TestCase;
 
 public class NativeFileObjectTest extends TestCase {
 

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetContainerTestTemplate.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetContainerTestTemplate.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetContainerTestTemplate.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetContainerTestTemplate.java Sun Jan 21 14:43:52 2007
@@ -27,7 +27,6 @@
 
 import org.apache.ftpserver.FtpRequestImpl;
 import org.apache.ftpserver.FtpSessionImpl;
-import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.listener.io.IOFtpResponseOutput;
 
 
@@ -110,7 +109,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onConnect(new FtpSessionImpl(), new IOFtpResponseOutput());
+        container.onConnect(new FtpSessionImpl(null), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -134,7 +133,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onDisconnect(new FtpSessionImpl(), new IOFtpResponseOutput());
+        container.onDisconnect(new FtpSessionImpl(null), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -158,7 +157,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onLogin(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onLogin(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -182,7 +181,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onDeleteStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onDeleteStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -206,7 +205,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onDeleteEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onDeleteEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -230,7 +229,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onUploadStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onUploadStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -254,7 +253,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onUploadEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onUploadEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -278,7 +277,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onDownloadStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onDownloadStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -302,7 +301,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onDownloadEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onDownloadEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -326,7 +325,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onRmdirStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onRmdirStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -350,7 +349,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onRmdirEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onRmdirEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -374,7 +373,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onMkdirStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onMkdirStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -398,7 +397,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onMkdirEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onMkdirEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -422,7 +421,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onAppendStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onAppendStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -446,7 +445,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onAppendEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onAppendEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -470,7 +469,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onUploadUniqueStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onUploadUniqueStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -494,7 +493,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onUploadUniqueEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onUploadUniqueEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -518,7 +517,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onRenameStart(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onRenameStart(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -542,7 +541,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onRenameEnd(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onRenameEnd(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));
@@ -566,7 +565,7 @@
         container.addFtplet("ftplet1", ftplet1);
         container.addFtplet("ftplet2", ftplet2);
         
-        container.onSite(new FtpSessionImpl(), new FtpRequestImpl("foo"), new IOFtpResponseOutput());
+        container.onSite(new FtpSessionImpl(null), new FtpRequestImpl("foo"), new IOFtpResponseOutput(null));
         
         assertEquals(2, calls.size());
         assertEquals("ftplet1", calls.get(0));

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/DirectoryListerTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/DirectoryListerTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/DirectoryListerTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/DirectoryListerTest.java Sun Jan 21 14:43:52 2007
@@ -25,10 +25,6 @@
 
 import org.apache.ftpserver.filesystem.NativeFileSystemView;
 import org.apache.ftpserver.ftplet.FileSystemView;
-import org.apache.ftpserver.listing.DirectoryLister;
-import org.apache.ftpserver.listing.FileFormater;
-import org.apache.ftpserver.listing.ListArgument;
-import org.apache.ftpserver.listing.NLSTFileFormater;
 import org.apache.ftpserver.test.TestUtil;
 import org.apache.ftpserver.usermanager.BaseUser;
 import org.apache.ftpserver.util.IoUtils;

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/LISTFileFormaterTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/LISTFileFormaterTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/LISTFileFormaterTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/LISTFileFormaterTest.java Sun Jan 21 14:43:52 2007
@@ -27,7 +27,6 @@
 import junit.framework.TestCase;
 
 import org.apache.ftpserver.ftplet.FileObject;
-import org.apache.ftpserver.listing.LISTFileFormater;
 
 public class LISTFileFormaterTest extends TestCase {
 

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentParserTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentParserTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentParserTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentParserTest.java Sun Jan 21 14:43:52 2007
@@ -19,9 +19,6 @@
 
 package org.apache.ftpserver.listing;
 
-import org.apache.ftpserver.listing.ListArgument;
-import org.apache.ftpserver.listing.ListArgumentParser;
-
 import junit.framework.TestCase;
 
 public class ListArgumentParserTest extends TestCase {

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/ListArgumentTest.java Sun Jan 21 14:43:52 2007
@@ -21,8 +21,6 @@
 
 import java.util.Arrays;
 
-import org.apache.ftpserver.listing.ListArgument;
-
 import junit.framework.TestCase;
 
 public class ListArgumentTest extends TestCase {

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/MLSTFileFormaterTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/MLSTFileFormaterTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/MLSTFileFormaterTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/MLSTFileFormaterTest.java Sun Jan 21 14:43:52 2007
@@ -27,7 +27,6 @@
 import junit.framework.TestCase;
 
 import org.apache.ftpserver.ftplet.FileObject;
-import org.apache.ftpserver.listing.MLSTFileFormater;
 
 public class MLSTFileFormaterTest extends TestCase {
 

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/NLSTFileFormaterTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/NLSTFileFormaterTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/NLSTFileFormaterTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/listing/NLSTFileFormaterTest.java Sun Jan 21 14:43:52 2007
@@ -26,7 +26,6 @@
 import junit.framework.TestCase;
 
 import org.apache.ftpserver.ftplet.FileObject;
-import org.apache.ftpserver.listing.NLSTFileFormater;
 
 public class NLSTFileFormaterTest extends TestCase {
 

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/BaseUserTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/BaseUserTest.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/BaseUserTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/usermanager/BaseUserTest.java Sun Jan 21 14:43:52 2007
@@ -21,10 +21,10 @@
 
 
 
+import junit.framework.TestCase;
+
 import org.apache.ftpserver.ftplet.Authority;
 import org.apache.ftpserver.ftplet.AuthorizationRequest;
-
-import junit.framework.TestCase;
 
 public class BaseUserTest extends TestCase {
     

Modified: incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java?view=diff&rev=498472&r1=498471&r2=498472
==============================================================================
--- incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java (original)
+++ incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java Sun Jan 21 14:43:52 2007
@@ -46,6 +46,8 @@
      */
     InetAddress getClientAddress();
     
+    InetAddress getServerAddress();
+    
     Certificate[] getClientCertificates();
     
     /**



Mime
View raw message