You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-commits@incubator.apache.org by ng...@apache.org on 2007/01/17 21:47:18 UTC

svn commit: r497189 [2/2] - in /incubator/ftpserver/trunk: core/src/java/org/apache/ftpserver/command/ core/src/java/org/apache/ftpserver/listener/ ftplet-api/src/java/org/apache/ftpserver/ftplet/

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=497189&r1=497188&r2=497189
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java Wed Jan 17 13:47:14 2007
@@ -30,6 +30,7 @@
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -72,7 +73,7 @@
             // argument check
             String fileName = request.getArgument();
             if(fileName == null) {
-                out.send(501, "STOR", null);
+                out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "STOR", null);
                 return;  
             }
             
@@ -102,26 +103,26 @@
                 log.debug("Exception getting file object", ex);
             }
             if(file == null) {
-                out.send(550, "STOR.invalid", fileName);
+                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOR.invalid", fileName);
                 return;
             }
             fileName = file.getFullName();
             
             // get permission
             if( !file.hasWritePermission() ) {
-                out.send(550, "STOR.permission", fileName);
+                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOR.permission", fileName);
                 return;
             }
             
             // get data connection
-            out.send(150, "STOR", fileName);
+            out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOR", fileName);
             InputStream is = null;
             try {
                 is = session.getDataInputStream();
             }
             catch(IOException ex) {
                 log.debug("Exception getting the input data stream", ex);
-                out.send(425, "STOR", fileName);
+                out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOR", fileName);
                 return;
             }
             
@@ -156,12 +157,12 @@
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
                 failure = true;
-                out.send(426, "STOR", fileName);
+                out.send(FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "STOR", fileName);
             }
             catch(IOException ex) {
                 log.debug("IOException during data transfer", ex);
                 failure = true;
-                out.send(551, "STOR", fileName);
+                out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOR", fileName);
             }
             finally {
                 IoUtils.close(bis);
@@ -170,7 +171,7 @@
             
             // if data transfer ok - send transfer complete message
             if(!failure) {
-                out.send(226, "STOR", fileName);
+                out.send(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=497189&r1=497188&r2=497189
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java Wed Jan 17 13:47:14 2007
@@ -31,6 +31,7 @@
 import org.apache.ftpserver.ftplet.FileSystemView;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
@@ -106,26 +107,26 @@
                 log.debug("Exception getting file object", ex);
             }
             if(file == null) {
-                out.send(550, "STOU", null);
+                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOU", null);
                 return;
             }
             String fileName = file.getFullName();
             
             // check permission
             if(!file.hasWritePermission()) {
-                out.send(550, "STOU.permission", fileName);
+                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, "STOU.permission", fileName);
                 return;
             }
             
             // get data connection
-            out.send(150, "STOU", null);
+            out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOU", null);
             InputStream is = null;
             try {
                 is = session.getDataInputStream();
             }
             catch(IOException ex) {
                 log.debug("Exception getting the input data stream", ex);
-                out.send(425, "STOU", fileName);
+                out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOU", fileName);
                 return;
             }
             
@@ -133,7 +134,7 @@
             boolean failure = false;
             BufferedInputStream bis = null;
             BufferedOutputStream bos = null;
-            out.send(250, "STOU", fileName);
+            out.send(FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "STOU", fileName);
             try {
                 
                 // open streams
@@ -163,12 +164,12 @@
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
                 failure = true;
-                out.send(426, "STOU", fileName);
+                out.send(FtpResponse.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED, "STOU", fileName);
             }
             catch(IOException ex) {
                 log.debug("IOException during data transfer", ex);
                 failure = true;
-                out.send(551, "STOU", fileName);
+                out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOU", fileName);
             }
             finally {
                 IoUtils.close(bis);
@@ -177,7 +178,7 @@
             
             // if data transfer ok - send transfer complete message
             if(!failure) {
-                out.send(226, "STOU", fileName);
+                out.send(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=497189&r1=497188&r2=497189
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STRU.java Wed Jan 17 13:47:14 2007
@@ -24,6 +24,7 @@
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.ftplet.Structure;
 import org.apache.ftpserver.listener.Connection;
 
@@ -51,7 +52,7 @@
         
         // argument check
         if(!request.hasArgument()) {
-            out.send(501, "STRU", null);
+            out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "STRU", null);
             return;  
         }
         
@@ -59,11 +60,11 @@
         char stru = request.getArgument().charAt(0);
         try  {
             session.setStructure(Structure.parseArgument(stru));
-            out.send(200, "STRU", null);
+            out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "STRU", null);
         } 
         catch(IllegalArgumentException e) {
             log.debug("Illegal structure argument: " + request.getArgument(), e);
-            out.send(504, "STRU", null);
+            out.send(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=497189&r1=497188&r2=497189
==============================================================================
--- 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 Wed Jan 17 13:47:14 2007
@@ -24,6 +24,7 @@
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
 
 /**
@@ -59,7 +60,7 @@
             systemName = systemName.replace(' ', '-');
         }
         // print server system info
-        out.send(215, "SYST", systemName);
+        out.send(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=497189&r1=497188&r2=497189
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/TYPE.java Wed Jan 17 13:47:14 2007
@@ -25,6 +25,7 @@
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.DataType;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.listener.Connection;
 
 /**
@@ -57,11 +58,11 @@
         // set type
         try {
             session.setDataType(DataType.parseArgument(type));
-            out.send(200, "TYPE", null);
+            out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "TYPE", null);
         } 
         catch(IllegalArgumentException e) {
             log.debug("Illegal type argument: " + request.getArgument(), e);
-            out.send(504, "TYPE", null);
+            out.send(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=497189&r1=497188&r2=497189
==============================================================================
--- 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 Wed Jan 17 13:47:14 2007
@@ -25,6 +25,7 @@
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.ftplet.User;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
@@ -67,7 +68,7 @@
             // argument check
             String userName = request.getArgument();
             if(userName == null) {
-                out.send(501, "USER", null);
+                out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "USER", null);
                 return;  
             }
             
@@ -75,7 +76,7 @@
             BaseUser user = (BaseUser)session.getUser();
             if(session.isLoggedIn()) {
                 if( userName.equals(user.getName()) ) {
-                    out.send(230, "USER", null);
+                    out.send(FtpResponse.REPLY_230_USER_LOGGED_IN, "USER", null);
                     success = true;
                 }
                 else {
@@ -87,7 +88,7 @@
             // anonymous login is not enabled
             boolean anonymous = userName.equals("anonymous");
             if( anonymous && (!conManager.isAnonymousLoginEnabled()) ) {
-                out.send(530, "USER.anonymous", null);
+                out.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "USER.anonymous", null);
                 return;
             }
             
@@ -95,7 +96,7 @@
             int currAnonLogin = stat.getCurrentAnonymousLoginNumber();
             int maxAnonLogin = conManager.getMaxAnonymousLogins();
             if( anonymous && (currAnonLogin >= maxAnonLogin) ) {
-                out.send(421, "USER.anonymous", null);
+                out.send(FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.anonymous", null);
                 return;
             }
             
@@ -103,7 +104,7 @@
             int currLogin = stat.getCurrentLoginNumber();
             int maxLogin = conManager.getMaxLogins();
             if(maxLogin != 0 && currLogin >= maxLogin) {
-                out.send(421, "USER.login", null);
+                out.send(FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.login", null);
                 return;
             }
             
@@ -116,7 +117,7 @@
                         stat.getCurrentUserLoginNumber(configUser, session.getClientAddress()) + 1);
                 
                 if(configUser.authorize(loginRequest) == null) {
-                    out.send(421, "USER.login", null);
+                    out.send(FtpResponse.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION, "USER.login", null);
                     return;
                 }
             }
@@ -125,10 +126,10 @@
             success = true;
             session.setUserArgument(userName);
             if(anonymous) {
-                out.send(331, "USER.anonymous", userName);
+                out.send(FtpResponse.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD, "USER.anonymous", userName);
             }
             else {
-                out.send(331, "USER", userName);
+                out.send(FtpResponse.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD, "USER", userName);
             }
         }
         finally {

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=497189&r1=497188&r2=497189
==============================================================================
--- 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 Wed Jan 17 13:47:14 2007
@@ -28,6 +28,7 @@
 import org.apache.ftpserver.ftplet.FileSystemView;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpResponse;
 import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletEnum;
@@ -87,7 +88,7 @@
             IpRestrictor ipRestrictor = serverContext.getIpRestrictor();
             if( !ipRestrictor.hasPermission(clientAddr) ) {
                 log.warn("No permission to access from " + hostAddress);
-                writer.send(530, "ip.restricted", null);
+                writer.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "ip.restricted", null);
                 return;
             }
             
@@ -96,12 +97,12 @@
             
             if(maxConnections != 0 && ftpStat.getCurrentConnectionNumber() > maxConnections) {
                 log.warn("Maximum connection limit reached.");
-                writer.send(530, "connection.limit", null);
+                writer.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "connection.limit", null);
                 return;
             }
             
             // everything is fine - go ahead 
-            writer.send(220, null, null);
+            writer.send(FtpResponse.REPLY_220_SERVICE_READY, null, null);
         }
     }
     
@@ -109,7 +110,7 @@
         session.setCurrentRequest(request);
         
         if(!hasPermission(session, request)) {
-            writer.send(530, "permission", null);
+            writer.send(FtpResponse.REPLY_530_NOT_LOGGED_IN, "permission", null);
             return;
         }
 
@@ -181,14 +182,14 @@
                 command.execute(connection, request, session, out);
             }
             else {
-                out.send(502, "not.implemented", null);
+                out.send(FtpResponse.REPLY_502_COMMAND_NOT_IMPLEMENTED, "not.implemented", null);
             }
         }
         catch(Exception ex) {
             
             // send error reply
             try { 
-                out.send(550, null, null);
+                out.send(FtpResponse.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, null, null);
             }
             catch(Exception ex1) {
             }

Modified: incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpResponse.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpResponse.java?view=diff&rev=497189&r1=497188&r2=497189
==============================================================================
--- incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpResponse.java (original)
+++ incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpResponse.java Wed Jan 17 13:47:14 2007
@@ -15,13 +15,218 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- */  
+ */
 
 package org.apache.ftpserver.ftplet;
 
 public interface FtpResponse {
 
+    /**
+     * 110 Restart marker reply. In this case, the text is exact and not left to
+     * the particular implementation; it must read: MARK yyyy = mmmm Where yyyy
+     * is User-process data stream marker, and mmmm server's equivalent marker
+     * (note the spaces between markers and "=").
+     */
+    public static final int REPLY_110_RESTART_MARKER_REPLY = 110;
+
+    /**
+     * 120 Service ready in nnn minutes.
+     */
+    public static final int REPLY_120_SERVICE_READY_IN_NNN_MINUTES = 120;
+
+    /**
+     * 125 Data connection already open; transfer starting.
+     */
+    public static final int REPLY_125_DATA_CONNECTION_ALREADY_OPEN = 125;
+
+    /**
+     * 150 File status okay; about to open data connection.
+     */
+    public static final int REPLY_150_FILE_STATUS_OKAY = 150;
+
+    /**
+     * 200 Command okay.
+     */
+    public static final int REPLY_200_COMMAND_OKAY = 200;
+
+    /**
+     * 202 Command not implemented, superfluous at this site.
+     */
+    public static final int REPLY_202_COMMAND_NOT_IMPLEMENTED = 202;
+
+    /**
+     * 211 System status, or system help reply.
+     */
+    public static final int REPLY_211_SYSTEM_STATUS_REPLY = 211;
+
+    /**
+     * 212 Directory status.
+     */
+    public static final int REPLY_212_DIRECTORY_STATUS = 212;
+
+    /**
+     * 213 File status.
+     */
+    public static final int REPLY_213_FILE_STATUS = 213;
+
+    /**
+     * 214 Help message. On how to use the server or the meaning of a particular
+     * non-standard command. This reply is useful only to the human user.
+     */
+    public static final int REPLY_214_HELP_MESSAGE = 214;
+
+    /**
+     * 215 NAME system type. Where NAME is an official system name from the list
+     * in the Assigned Numbers document.
+     */
+    public static final int REPLY_215_NAME_SYSTEM_TYPE = 215;
+
+    /**
+     * 220 Service ready for new user.
+     */
+    public static final int REPLY_220_SERVICE_READY = 220;
+
+    /**
+     * Service closing control connection. Logged out if appropriate.
+     */
+    public static final int REPLY_221_CLOSING_CONTROL_CONNECTION = 221;
+
+    /**
+     * 225 Data connection open; no transfer in progress.
+     */
+    public static final int REPLY_225_DATA_CONNECTION_OPEN_NO_TRANSFER_IN_PROGRESS = 225;
+
+    /**
+     * Closing data connection. Requested file action successful (for example,
+     * file transfer or file abort).
+     */
+    public static final int REPLY_226_CLOSING_DATA_CONNECTION = 226;
+
+    /**
+     * 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).
+     */
+    public static final int REPLY_227_ENTERING_PASSIVE_MODE = 227;
+
+    /**
+     * 230 User logged in, proceed.
+     */
+    public static final int REPLY_230_USER_LOGGED_IN = 230;
+
+    /**
+     * 250 Requested file action okay, completed.
+     */
+    public static final int REPLY_250_REQUESTED_FILE_ACTION_OKAY = 250;
+
+    /**
+     * 257 "PATHNAME" created.
+     */
+    public static final int REPLY_257_PATHNAME_CREATED = 257;
+
+    /**
+     * 331 User name okay, need password.
+     */
+    public static final int REPLY_331_USER_NAME_OKAY_NEED_PASSWORD = 331;
+
+    /**
+     * 332 Need account for login.
+     */
+    public static final int REPLY_332_NEED_ACCOUNT_FOR_LOGIN = 332;
+
+    /**
+     * 350 Requested file action pending further information.
+     */
+    public static final int REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION = 350;
+
+    /**
+     * 421 Service not available, closing control connection. This may be a
+     * reply to any command if the service knows it must shut down.
+     */
+    public static final int REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION = 421;
+
+    /**
+     * 425 Can't open data connection.
+     */
+    public static final int REPLY_425_CANT_OPEN_DATA_CONNECTION = 425;
+
+    /**
+     * 426 Connection closed; transfer aborted.
+     */
+    public static final int REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED = 426;
+
+    /**
+     * 450 Requested file action not taken. File unavailable (e.g., file busy).
+     */
+    public static final int REPLY_450_REQUESTED_FILE_ACTION_NOT_TAKEN = 450;
+
+    /**
+     * 451 Requested action aborted: local error in processing.
+     */
+    public static final int REPLY_451_REQUESTED_ACTION_ABORTED = 451;
+
+    /**
+     * 452 Requested action not taken. Insufficient storage space in system.
+     */
+    public static final int REPLY_452_REQUESTED_ACTION_NOT_TAKEN = 452;
+
+    /**
+     * 500 Syntax error, command unrecognized. This may include errors such as
+     * command line too long.
+     */
+    public static final int REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED = 500;
+
+    /**
+     * 501 Syntax error in parameters or arguments.
+     */
+    public static final int REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS = 501;
+
+    /**
+     * 502 Command not implemented.
+     */
+    public static final int REPLY_502_COMMAND_NOT_IMPLEMENTED = 502;
+
+    /**
+     * 503 Bad sequence of commands.
+     */
+    public static final int REPLY_503_BAD_SEQUENCE_OF_COMMANDS = 503;
+
+    /**
+     * 504 Command not implemented for that parameter.
+     */
+    public static final int REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = 504;
+
+    /**
+     * 530 Not logged in.
+     */
+    public static final int REPLY_530_NOT_LOGGED_IN = 530;
+
+    /**
+     * 532 Need account for storing files.
+     */
+    public static final int REPLY_532_NEED_ACCOUNT_FOR_STORING_FILES = 532;
+
+    /**
+     * 550 Requested action not taken. File unavailable (e.g., file not found,
+     * no access).
+     */
+    public static final int REPLY_550_REQUESTED_ACTION_NOT_TAKEN = 550;
+
+    /**
+     * 551 Requested action aborted: page type unknown.
+     */
+    public static final int REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN = 551;
+
+    /**
+     * 552 Requested file action aborted. Exceeded storage allocation (for
+     * current directory or dataset).
+     */
+    public static final int REPLY_552_REQUESTED_FILE_ACTION_ABORTED_EXCEEDED_STORAGE = 552;
+
+    /**
+     * 553 Requested action not taken. File name not allowed.
+     */
+    public static final int REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED = 553;
+
     int getCode();
-    
+
     String getMessage();
 }