incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: incubator-ftpserver/src/java/org/apache/ftpserver/util VirtualDirectory.java
Date Wed, 04 Aug 2004 01:34:13 GMT
hammant     2004/08/03 18:34:13

  Modified:    src/java/org/apache/ftpserver AbstractFtpConfig.java
                        BaseFtpConnection.java FtpConnection.java
                        FtpDataConnection.java FtpServerImpl.java
                        FtpWriter.java SiteCommandHandler.java
               src/java/org/apache/ftpserver/interfaces
                        FtpConnectionObserver.java
               src/java/org/apache/ftpserver/remote FtpConfig.java
               src/java/org/apache/ftpserver/remote/adapter
                        FtpConnectionObserverAdapter.java
               src/java/org/apache/ftpserver/util VirtualDirectory.java
  Added:       src/java/org/apache/ftpserver/interfaces
                        FtpCommandHandlerMonitor.java
                        FtpDataConnectionMonitor.java FtpWriterMonitor.java
  Log:
  more of the refactoring to allow non-Avalon usages of FtpServer
  
  Revision  Changes    Path
  1.2       +8 -2      incubator-ftpserver/src/java/org/apache/ftpserver/AbstractFtpConfig.java
  
  Index: AbstractFtpConfig.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/AbstractFtpConfig.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractFtpConfig.java	27 Jul 2004 20:16:42 -0000	1.1
  +++ AbstractFtpConfig.java	4 Aug 2004 01:34:12 -0000	1.2
  @@ -13,7 +13,7 @@
    * @author Paul Hammant
    * @version $Revision$
    */
  -public class AbstractFtpConfig {
  +public abstract class AbstractFtpConfig {
   
       protected FtpStatus  mStatus                  = null;
       protected ConnectionService mConService       = null;
  @@ -201,5 +201,11 @@
           }
           return systemName;
       }
  +
  +    public abstract void releaseDataPort(int miPort);
  +
  +    public abstract int getDataPort();
  +
  +    public abstract void dispose();
   
   }
  
  
  
  1.4       +9 -9      incubator-ftpserver/src/java/org/apache/ftpserver/BaseFtpConnection.java
  
  Index: BaseFtpConnection.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/BaseFtpConnection.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BaseFtpConnection.java	28 Jul 2004 16:09:24 -0000	1.3
  +++ BaseFtpConnection.java	4 Aug 2004 01:34:12 -0000	1.4
  @@ -82,7 +82,7 @@
   
       protected static final Class[] METHOD_INPUT_SIG = new Class[] {FtpRequest.class, FtpWriter.class};
   
  -    protected AvalonFtpConfig mConfig                 = null;
  +    protected AbstractFtpConfig mConfig                 = null;
       protected FtpStatus mFtpStatus              = null;
       protected FtpDataConnection mDataConnection = null;
       protected FtpUser mUser                     = null;
  @@ -96,7 +96,7 @@
       /**
        * Set configuration file and the control socket.
        */
  -    public BaseFtpConnection(AvalonFtpConfig ftpConfig) {
  +    public BaseFtpConnection(AbstractFtpConfig ftpConfig) {
         mConfig = ftpConfig;
         mFtpStatus = mConfig.getStatus();
         mUser = new FtpUser();
  @@ -108,7 +108,7 @@
       public void handleConnection(final Socket socket) {
           mControlSocket = socket;
           InetAddress clientAddress = mControlSocket.getInetAddress();
  -        mConfig.getLogger().info("Handling new request from " + clientAddress.getHostAddress());
  +        mObserver.newRequest("Handling new request from " + clientAddress.getHostAddress());
           mDataConnection = new FtpDataConnection(mConfig);
           mUser.setClientAddress(clientAddress);
           mConfig.getConnectionService().newConnection(this);
  @@ -182,7 +182,7 @@
                   throw (IOException)th;
                }
                else {
  -                mConfig.getLogger().warn("BaseFtpConnection.service()", th);
  +                mObserver.unknownServiceException("BaseFtpConnection.service()", th);
                }
            }
            catch(Exception ex) {
  @@ -191,7 +191,7 @@
                   throw (IOException)ex;
                }
                else {
  -                mConfig.getLogger().warn("BaseFtpConnection.service()", ex);
  +                mObserver.unknownServiceException("BaseFtpConnection.service()", ex);
                }
            }
       }
  @@ -244,9 +244,9 @@
                       try {
                           spy.request(str + '\n');
                       }
  -                    catch(Exception ex) {
  +                    catch(IOException ex) {
                           mSpy = null;
  -                        mConfig.getLogger().error("BaseFtpConnection.spyPrint()", ex);
  +                        mObserver.requestError("BaseFtpConnection.spyPrint()", ex);
                       }
                   }
               };
  @@ -318,7 +318,7 @@
       /**
        * Get config object
        */
  -    public AvalonFtpConfig getConfig() {
  +    public AbstractFtpConfig getConfig() {
           return mConfig;
       }
   
  
  
  
  1.4       +2 -2      incubator-ftpserver/src/java/org/apache/ftpserver/FtpConnection.java
  
  Index: FtpConnection.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/FtpConnection.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FtpConnection.java	28 Jul 2004 16:09:24 -0000	1.3
  +++ FtpConnection.java	4 Aug 2004 01:34:12 -0000	1.4
  @@ -110,7 +110,7 @@
       /**
        * Set configuration file and the control socket.
        */
  -    public FtpConnection(AvalonFtpConfig cfg) {
  +    public FtpConnection(AbstractFtpConfig cfg) {
           super(cfg);
       }
   
  
  
  
  1.3       +23 -13    incubator-ftpserver/src/java/org/apache/ftpserver/FtpDataConnection.java
  
  Index: FtpDataConnection.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/FtpDataConnection.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FtpDataConnection.java	28 Jul 2004 16:09:24 -0000	1.2
  +++ FtpDataConnection.java	4 Aug 2004 01:34:12 -0000	1.3
  @@ -56,9 +56,16 @@
    */
   package org.apache.ftpserver;
   
  +import org.apache.ftpserver.interfaces.FtpDataConnectionMonitor;
  +import org.apache.avalon.framework.context.Contextualizable;
  +import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.activity.Disposable;
  +
   import java.net.InetAddress;
   import java.net.ServerSocket;
   import java.net.Socket;
  +import java.io.IOException;
   
   
   /**
  @@ -67,9 +74,11 @@
    *
    * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
    */
  -class FtpDataConnection {
  +class FtpDataConnection
  +                
  +        {
   
  -    private AvalonFtpConfig mConfig = null;
  +    private AbstractFtpConfig mConfig = null;
       private Socket mDataSoc = null;
       private ServerSocket mServSoc = null;
   
  @@ -78,13 +87,14 @@
   
       private boolean mbPort = false;
       private boolean mbPasv = false;
  +    private FtpDataConnectionMonitor ftpDataConnectionMonitor;
   
   
       /**
        * Constructor.
        * @param cfg ftp config object.
        */
  -    public FtpDataConnection(AvalonFtpConfig cfg) {
  +    public FtpDataConnection(AbstractFtpConfig cfg) {
           mConfig = cfg;
       }
   
  @@ -99,8 +109,8 @@
               try {
                   mDataSoc.close();
               }
  -            catch(Exception ex) {
  -                mConfig.getLogger().warn("FtpDataConnection.closeDataSocket()", ex);
  +            catch(IOException ex) {
  +                ftpDataConnectionMonitor.socketCloseException("FtpDataConnection.closeDataSocket()",
ex);
               }
               mDataSoc = null;
           }
  @@ -110,8 +120,8 @@
               try {
                   mServSoc.close();
               }
  -            catch(Exception ex) {
  -                mConfig.getLogger().warn("FtpDataConnection.closeDataSocket()", ex);
  +            catch(IOException ex) {
  +                ftpDataConnectionMonitor.socketCloseException("FtpDataConnection.closeDataSocket()",
ex);
               }
               mConfig.releaseDataPort(miPort);
               mServSoc = null;
  @@ -149,7 +159,7 @@
               // open passive server socket and get parameters
               int port = getPassivePort();
               if(port == -1) {
  -                throw new Exception("No available port found for PASV connection.");
  +                throw new IOException("No available port found for PASV connection.");
               }
               mServSoc = new ServerSocket(port, 1, mConfig.getSelfAddress());
               mAddress = mConfig.getServerAddress();
  @@ -160,9 +170,9 @@
               mbPasv = true;
               bRet = true;
           }
  -        catch(Exception ex) {
  +        catch(IOException ex) {
               mServSoc = null;
  -            mConfig.getLogger().warn("FtpDataConnection.setPasvCommand()", ex);
  +            ftpDataConnectionMonitor.serverSocketOpenException("FtpDataConnection.setPasvCommand()",
ex);
           }
           return bRet;
       }
  @@ -199,8 +209,8 @@
                   mDataSoc = mServSoc.accept();
               }
           }
  -        catch(Exception ex) {
  -            mConfig.getLogger().warn("FtpDataConnection.getDataSocket()", ex);
  +        catch(IOException ex) {
  +            ftpDataConnectionMonitor.socketException("FtpDataConnection.getDataSocket()",
ex);
               mDataSoc = null;
           }
   
  
  
  
  1.4       +8 -112    incubator-ftpserver/src/java/org/apache/ftpserver/FtpServerImpl.java
  
  Index: FtpServerImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/FtpServerImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FtpServerImpl.java	28 Jul 2004 16:09:24 -0000	1.3
  +++ FtpServerImpl.java	4 Aug 2004 01:34:12 -0000	1.4
  @@ -56,27 +56,14 @@
    */
   package org.apache.ftpserver;
   
  -import java.net.InetAddress;
  -import java.net.ServerSocket;
  -
   import org.apache.avalon.cornerstone.services.connection.ConnectionHandler;
   import org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory;
   import org.apache.avalon.cornerstone.services.connection.ConnectionManager;
  -import org.apache.avalon.cornerstone.services.sockets.ServerSocketFactory;
   import org.apache.avalon.cornerstone.services.sockets.SocketManager;
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.ContextException;
  -import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.service.ServiceException;
  -import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.service.Serviceable;
   import org.apache.ftpserver.interfaces.FtpServerInterface;
   
  +import java.net.ServerSocket;
  +
   
   /**
    * Ftp server starting point. Avalon framework will load this
  @@ -90,103 +77,12 @@
    * @author  Paul Hammant <Paul_Hammant@yahoo.com>
    * @version 1.0
    */
  -public class FtpServerImpl extends AbstractLogEnabled
  -                           implements FtpServerInterface,
  -                                      Contextualizable,
  -                                      Serviceable,
  -                                      Configurable,
  -                                      Disposable,
  -                                      ConnectionHandlerFactory {
  -
  -    private ServerSocket mServerSocket    = null;
  -    private SocketManager mSocManager     = null;
  -    private ConnectionManager mConManager = null;
  -    private Context mContext              = null;
  -    private AvalonFtpConfig mConfig             = null;
  -
  -    /**
  -     * Default constructor - does nothing.
  -     */
  -    public FtpServerImpl() {
  -    }
  -
  -    /**
  -     * Set application context - first spep.
  -     */
  -    public void contextualize(Context context) throws ContextException {
  -        try {
  -            mConfig = new AvalonFtpConfig();
  -            mConfig.setLogger(getLogger());
  -            mContext = context;
  -            mConfig.setContext(mContext);
  -        }
  -        catch(Exception ex) {
  -            getLogger().error("FtpServerImpl.contextualize()", ex);
  -            throw new ContextException("FtpServerImpl.contextualize()", ex);
  -        }
  -    }
  -
  -
  -    /**
  -     * Get all managers - second step.
  -     * @phoenix:dependency name="org.apache.avalon.cornerstone.services.sockets.SocketManager"
  -     * @phoenix:dependency name="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
  -     * @phoenix:dependency name="org.apache.ftpserver.usermanager.UserManagerInterface"
  -     * @phoenix:dependency name="org.apache.ftpserver.ip.IpRestrictorInterface"
  -     *
  -     */
  -    public void service(ServiceManager serviceManager) throws ServiceException {
  -        mConfig.setServiceManager(serviceManager);
  -        mSocManager = (SocketManager)serviceManager.lookup(SocketManager.ROLE);
  -        mConManager = (ConnectionManager)serviceManager.lookup(ConnectionManager.ROLE);
  -    }
  -
  -
  -    /**
  -     * Configure the server - third step.
  -     *
  -     * @param conf the XML configuration block
  -     */
  -    public void configure(Configuration conf) throws ConfigurationException {
  -       try {
  -            mConfig.setConfiguration(conf);
  -
  -            // open server socket
  -            ServerSocketFactory factory = mSocManager.getServerSocketFactory("plain");
  -            InetAddress serverAddress = mConfig.getSelfAddress();
  -            if(serverAddress == null) {
  -                mServerSocket = factory.createServerSocket(mConfig.getServerPort(), 5);
  -            }
  -            else {
  -                mServerSocket = factory.createServerSocket(mConfig.getServerPort(), 5,
serverAddress);
  -            }
  -            mConManager.connect(DISPLAY_NAME, mServerSocket, this);
  -
  -            System.out.println("FTP server ready!");
  -            if(mConfig.isRemoteAdminAllowed()) {
  -                System.out.println("You can start the remote admin by executing \"java
-jar ftp-admin.jar\".");
  -            }
  -       }
  -       catch(Exception ex) {
  -           getLogger().error("FtpServerImpl.configure()", ex);
  -           throw new ConfigurationException(ex.getMessage(), ex);
  -       }
  -    }
  +public class FtpServerImpl implements FtpServerInterface, ConnectionHandlerFactory {
   
  -    /**
  -     * Release all resources.
  -     */
  -    public void dispose() {
  -        getLogger().info("Closing Ftp server...");
  -        if (mConfig != null) {
  -            try {
  -                mConfig.dispose();
  -            }
  -            catch(Exception ex) {
  -                getLogger().warn("FtpServerImpl.dispose()", ex);
  -            }
  -        }
  -    }
  +    protected ServerSocket mServerSocket;
  +    protected SocketManager mSocManager;
  +    protected ConnectionManager mConManager;
  +    protected AbstractFtpConfig mConfig;
   
       /**
        * Construct an appropriate <code>ConnectionHandler</code>
  
  
  
  1.3       +7 -5      incubator-ftpserver/src/java/org/apache/ftpserver/FtpWriter.java
  
  Index: FtpWriter.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/FtpWriter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FtpWriter.java	28 Jul 2004 16:09:24 -0000	1.2
  +++ FtpWriter.java	4 Aug 2004 01:34:12 -0000	1.3
  @@ -63,6 +63,7 @@
   
   import org.apache.ftpserver.util.Message;
   import org.apache.ftpserver.interfaces.SpyConnectionInterface;
  +import org.apache.ftpserver.interfaces.FtpWriterMonitor;
   
   /**
    * Writer object used by the server. It has the spying capability.
  @@ -74,12 +75,13 @@
   
       private OutputStreamWriter mOriginalWriter;
       private SpyConnectionInterface mSpy;
  -    private AvalonFtpConfig mConfig;
  +    private AbstractFtpConfig mConfig;
  +    private FtpWriterMonitor ftpWriterMonitor;
   
       /**
        * Constructor - set the actual writer object
        */
  -    public FtpWriter(Socket soc, AvalonFtpConfig config) throws IOException {
  +    public FtpWriter(Socket soc, AbstractFtpConfig config) throws IOException {
           mOriginalWriter = new OutputStreamWriter(soc.getOutputStream());
           mConfig = config;
       }
  @@ -109,9 +111,9 @@
                       try {
                           spy.response(str);
                       }
  -                    catch(Exception ex) {
  +                    catch(IOException ex) {
                           mSpy = null;
  -                        mConfig.getLogger().error("FtpWriter.spyResponse()", ex);
  +                        ftpWriterMonitor.responseException("FtpWriter.spyResponse()", ex);
                       }
                   }
               };
  
  
  
  1.4       +17 -14    incubator-ftpserver/src/java/org/apache/ftpserver/SiteCommandHandler.java
  
  Index: SiteCommandHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/SiteCommandHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SiteCommandHandler.java	28 Jul 2004 16:09:24 -0000	1.3
  +++ SiteCommandHandler.java	4 Aug 2004 01:34:12 -0000	1.4
  @@ -63,11 +63,13 @@
   import java.util.StringTokenizer;
   import java.text.SimpleDateFormat;
   import java.lang.reflect.Method;
  +import java.io.IOException;
   
   import org.apache.ftpserver.util.StringUtils;
   import org.apache.ftpserver.ip.IpRestrictorInterface;
   import org.apache.ftpserver.usermanager.User;
   import org.apache.ftpserver.usermanager.UserManagerInterface;
  +import org.apache.ftpserver.interfaces.FtpCommandHandlerMonitor;
   
   /**
    * Handle ftp site command.
  @@ -86,14 +88,15 @@
   
       protected final static Class[] INPUT_SIG = new Class[] {String[].class, FtpRequest.class};
   
  -    private AvalonFtpConfig mConfig;
  +    private AbstractFtpConfig mConfig;
       private FtpUser mUser;
  +    private FtpCommandHandlerMonitor ftpCommandHandlerMonitor;
   
   
       /**
        * Constructor - set the configuration object
        */
  -    public SiteCommandHandler(AvalonFtpConfig cfg, FtpUser user) {
  +    public SiteCommandHandler(AbstractFtpConfig cfg, FtpUser user) {
           mConfig = cfg;
           mUser = user;
       }
  @@ -114,7 +117,7 @@
                       response = (String)actionMet.invoke(this, new Object[] {argArray, request});
                   }
                   catch(Throwable th) {
  -                    mConfig.getLogger().warn("SiteCommandHandler.getResponse()", th);
  +                    ftpCommandHandlerMonitor.unknownResponseException("SiteCommandHandler.getResponse()",
th);
                       response = mConfig.getStatus().getResponse(530, request, mUser, null);
                   }
               }
  @@ -178,8 +181,8 @@
               ipRestrictor.save();
               response = mConfig.getStatus().getResponse(200, cmd, mUser, null);
           }
  -        catch(Exception ex) {
  -            mConfig.getLogger().warn("SiteCommandHandler.doADDIP()", ex);
  +        catch(IOException ex) {
  +            ftpCommandHandlerMonitor.ipBlockException("SiteCommandHandler.doADDIP()", ex);
               response = mConfig.getStatus().getResponse(451, cmd, mUser, null);
           }
           return response;
  @@ -212,8 +215,8 @@
               }
               response = mConfig.getStatus().getResponse(200, cmd, mUser, null);
           }
  -        catch(Exception ex) {
  -            mConfig.getLogger().warn("SiteCommandHandler.doADDUSER()", ex);
  +        catch(UserManagerException ex) {
  +            ftpCommandHandlerMonitor.addUserException("SiteCommandHandler.doADDUSER()",
ex);
               response = mConfig.getStatus().getResponse(451, cmd, mUser, null);
           }
           return response;
  @@ -235,8 +238,8 @@
               ipRestrictor.save();
               response = mConfig.getStatus().getResponse(200, cmd, mUser, null);
           }
  -        catch(Exception ex) {
  -            mConfig.getLogger().warn("SiteCommandHandler.doDELIP()", ex);
  +        catch(IOException ex) {
  +            ftpCommandHandlerMonitor.ipBlockException("SiteCommandHandler.doDELIP()", ex);
               response = mConfig.getStatus().getResponse(451, cmd, mUser, null);
           }
           return response;
  @@ -256,8 +259,8 @@
               mConfig.getUserManager().delete(args[1]);
               response = mConfig.getStatus().getResponse(200, cmd, mUser, null);
           }
  -        catch(Exception ex) {
  -            mConfig.getLogger().warn("SiteCommandHandler.doDELUSER()", ex);
  +        catch(UserManagerException ex) {
  +            ftpCommandHandlerMonitor.deleteUserException("SiteCommandHandler.doDELUSER()",
ex);
               response = mConfig.getStatus().getResponse(451, cmd, mUser, null);
           }
           return response;
  @@ -405,8 +408,8 @@
                   bSuccess = false;
               }
           }
  -        catch(Exception ex) {
  -            mConfig.getLogger().warn("SiteCommandHandler.doSETATTR()", ex);
  +        catch(UserManagerException ex) {
  +            ftpCommandHandlerMonitor.setAttrException("SiteCommandHandler.doSETATTR()",
ex);
               bSuccess = false;
           }
   
  
  
  
  1.2       +10 -1     incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/FtpConnectionObserver.java
  
  Index: FtpConnectionObserver.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/FtpConnectionObserver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FtpConnectionObserver.java	31 Mar 2003 06:50:25 -0000	1.1
  +++ FtpConnectionObserver.java	4 Aug 2004 01:34:13 -0000	1.2
  @@ -58,6 +58,8 @@
   
   import org.apache.ftpserver.FtpUser;
   
  +import java.io.IOException;
  +
   /**
    * This observer interface monitors all the ftp connections.
    *
  @@ -83,4 +85,11 @@
        * @param user updated user object
        */
       void updateConnection(final FtpUser user);
  +
  +    void requestError(String message, IOException ex);
  +
  +    void unknownServiceException(String message, Throwable th);
  +
  +    void newRequest(String message);
  +
   }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/FtpCommandHandlerMonitor.java
  
  Index: FtpCommandHandlerMonitor.java
  ===================================================================
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.UserManagerException;
  
  import java.io.IOException;
  
  /**
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public interface FtpCommandHandlerMonitor {
      void unknownResponseException(String message, Throwable th);
  
      void ipBlockException(String message, IOException ex);
  
      void addUserException(String message, UserManagerException ex);
  
      void setAttrException(String message, UserManagerException ex);
  
      void deleteUserException(String message, UserManagerException ex);
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/FtpDataConnectionMonitor.java
  
  Index: FtpDataConnectionMonitor.java
  ===================================================================
  package org.apache.ftpserver.interfaces;
  
  import java.io.IOException;
  
  /**
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public interface FtpDataConnectionMonitor {
      void socketCloseException(String message, IOException ex);
      void serverSocketOpenException(String message, IOException ex);
      void socketException(String message, IOException ex);
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/FtpWriterMonitor.java
  
  Index: FtpWriterMonitor.java
  ===================================================================
  package org.apache.ftpserver.interfaces;
  
  import java.io.IOException;
  
  /**
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public interface FtpWriterMonitor {
      void responseException(String message, IOException ex);
  }
  
  
  
  1.2       +4 -4      incubator-ftpserver/src/java/org/apache/ftpserver/remote/FtpConfig.java
  
  Index: FtpConfig.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/remote/FtpConfig.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FtpConfig.java	31 Mar 2003 06:50:26 -0000	1.1
  +++ FtpConfig.java	4 Aug 2004 01:34:13 -0000	1.2
  @@ -74,7 +74,7 @@
   public
   class FtpConfig implements FtpConfigInterface {
   
  -    private org.apache.ftpserver.FtpConfig mConfig;
  +    private org.apache.ftpserver.AbstractFtpConfig mConfig;
   
       private IpRestrictor mIpRestrictor;
       private UserManager mUserManager;
  @@ -84,7 +84,7 @@
       /**
        * Constructor - sets the actual config object.
        */
  -    public FtpConfig(org.apache.ftpserver.FtpConfig config) throws RemoteException {
  +    public FtpConfig(org.apache.ftpserver.AbstractFtpConfig config) throws RemoteException
{
           mConfig = config;
           mIpRestrictor = new IpRestrictor(config.getIpRestrictor());
           mUserManager  = new UserManager(config.getUserManager());
  @@ -97,7 +97,7 @@
       /**
        * Get config
        */
  -    public org.apache.ftpserver.FtpConfig getConfig() {
  +    public org.apache.ftpserver.AbstractFtpConfig getConfig() {
           return mConfig;
       }
   
  
  
  
  1.2       +15 -1     incubator-ftpserver/src/java/org/apache/ftpserver/remote/adapter/FtpConnectionObserverAdapter.java
  
  Index: FtpConnectionObserverAdapter.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/remote/adapter/FtpConnectionObserverAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FtpConnectionObserverAdapter.java	31 Mar 2003 06:50:26 -0000	1.1
  +++ FtpConnectionObserverAdapter.java	4 Aug 2004 01:34:13 -0000	1.2
  @@ -57,6 +57,8 @@
   package org.apache.ftpserver.remote.adapter;
   
   import java.rmi.RemoteException;
  +import java.io.IOException;
  +
   import org.apache.ftpserver.FtpUser;
   import org.apache.ftpserver.remote.interfaces.FtpConnectionObserver;
   
  @@ -137,5 +139,17 @@
                   mObserver = null;
               }
           }
  +    }
  +
  +    public void requestError(String message, IOException ex) {
  +        //TODO
  +    }
  +
  +    public void unknownServiceException(String message, Throwable th) {
  +        //TODO
  +    }
  +
  +    public void newRequest(String message) {
  +        //TODO
       }
   }
  
  
  
  1.2       +3 -3      incubator-ftpserver/src/java/org/apache/ftpserver/util/VirtualDirectory.java
  
  Index: VirtualDirectory.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/util/VirtualDirectory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VirtualDirectory.java	31 Mar 2003 06:50:36 -0000	1.1
  +++ VirtualDirectory.java	4 Aug 2004 01:34:13 -0000	1.2
  @@ -116,7 +116,7 @@
       /**
        * Set root directory.
        */
  -    public void setRootDirectory(String root) throws IOException {
  +    public void setRootDirectory(String root) {
          mstRoot = normalizeSeparateChar(root);
   
          // if not ends with '/' - add one
  @@ -189,7 +189,7 @@
       /**
        * Change directory. The current directory will never have '/'
        * at the end unless it is '/'.
  -     * @param dirName change the current working directory.
  +     * @param virtualDir change the current working directory.
        * @return true if success
        */
       public boolean changeDirectory(String virtualDir) {
  
  
  

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


Mime
View raw message