You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ra...@apache.org on 2002/03/31 18:41:46 UTC

cvs commit: jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver FtpRequest.java

rana_b      02/03/31 08:41:46

  Modified:    ftpserver/src/java/org/apache/avalon/ftpserver
                        FtpRequest.java
  Log:
  Implementation list removed
  
  Revision  Changes    Path
  1.3       +1 -121    jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/FtpRequest.java
  
  Index: FtpRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/FtpRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FtpRequest.java	6 Mar 2002 13:54:40 -0000	1.2
  +++ FtpRequest.java	31 Mar 2002 16:41:46 -0000	1.3
  @@ -8,8 +8,6 @@
   
   package org.apache.avalon.ftpserver;
   
  -import java.util.*;
  -
   /**
    * Ftp command request class. We can access command, line and argument using 
    * <code>{CMD}, {ARG}</code> within ftp status file. This represents 
  @@ -20,61 +18,6 @@
   public
   class FtpRequest {
       
  -    /**
  -     * Carriage return and new line.
  -     */
  -    private final static String CRLF = "\r\n";
  -    
  -    /**
  -     * All supported ftp commands.
  -     */
  -    public final static String[] IMPLEMENTED_COMMANDS = {
  -        "ABOR",
  -        "APPE",    
  -        "CDUP",
  -        "CWD",
  -        "DELE",   
  -        "HELP",    
  -        "LIST",
  -        "MDTM",    
  -        "MKD",        
  -        "MODE",
  -        "NLST",    
  -        "NOOP",
  -        "PASS",
  -        "PASV",    
  -        "PORT",
  -        "PWD",
  -        "QUIT",
  -        "REST",    
  -        "RETR",
  -        "RMD", 
  -        "RNFR",
  -        "RNTO",
  -        "SITE",    
  -        "SIZE", 
  -        "STAT",    
  -        "STOR",
  -        "STOU",    
  -        "STRU",
  -        "SYST",
  -        "TYPE",
  -        "USER"
  -    }; 
  -    
  -    /**
  -     * These ftp commands are not implemented.
  -     */
  -    public final static String[] NON_IMPLEMENTED_COMMANDS = {
  -        "ACCT",
  -        "ALLO",
  -        "FEAT",
  -        "MLSD", 
  -        "MLST",
  -        "REIN",
  -        "SMNT", 
  -    }; 
  -    
       private String mstLine     = null;
       private String mstCommand  = null;
       private String mstArgument = null;
  @@ -85,18 +28,8 @@
        *
        * @param commandLine ftp input command line.
        */
  -    public FtpRequest(String commandLine) throws FtpException {
  -        
  -        if(commandLine == null) {
  -            throw new NullPointerException("Ftp command is null");
  -        }
  -        
  -        // check command
  +    public FtpRequest(String commandLine) {
           mstLine = commandLine.trim();
  -        if( mstLine.equals("") ) {
  -            throw new FtpException(500);
  -        }
  -        
           parse();
       }
        
  @@ -148,57 +81,4 @@
           return getArgument() != null;
       }
       
  -    
  -    /**
  -     * Is an implemented ftp command?
  -     */
  -    public static boolean isImplementedFtpCommand(String cmd) {
  -        
  -        // get the actual ftp command
  -        cmd = cmd.toUpperCase();
  -        if( (cmd.length()>0) && (cmd.charAt(0) == 'X') ) {
  -            cmd = cmd.substring(1);
  -        }
  -        
  -        // now compare
  -        boolean bMatch = false;
  -        for(int i=IMPLEMENTED_COMMANDS.length; --i>=0; ) {
  -            if(IMPLEMENTED_COMMANDS[i].equals(cmd)) {
  -                bMatch = true;
  -                break;
  -            }
  -        }
  -
  -        return bMatch;
  -    }
  -    
  -    /**
  -     * Is a non-implemented ftp command?
  -     */
  -    public static boolean isNonImplementedFtpCommand(String cmd) {
  -        
  -        // get the actual ftp command
  -        cmd = cmd.toUpperCase();
  -        if( (cmd.length()>0) && (cmd.charAt(0) == 'X') ) {
  -            cmd = cmd.substring(1);
  -        }
  -        
  -        // now compare
  -        boolean bMatch = false;
  -        for(int i=NON_IMPLEMENTED_COMMANDS.length; --i>=0; ) {
  -            if(NON_IMPLEMENTED_COMMANDS[i].equals(cmd)) {
  -                bMatch = true;
  -                break;
  -            }
  -        }
  -        return bMatch;
  -    }
  -     
  -    /**
  -     * Is it a ftp command (both implemented and non-implemented)?
  -     */
  -    public static boolean isFtpCommand(String cmd) {
  -        return isImplementedFtpCommand(cmd) || isNonImplementedFtpCommand(cmd);
  -    }
  -     
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>