org.apache.ftpserver.ftplet
Class DefaultFtpletContainer

java.lang.Object
  extended by org.apache.ftpserver.ftplet.DefaultFtpletContainer
All Implemented Interfaces:
Ftplet, FtpletContainer

public class DefaultFtpletContainer
extends java.lang.Object
implements FtpletContainer

This ftplet calls other ftplet methods and returns appropriate return value.


Constructor Summary
DefaultFtpletContainer()
           
 
Method Summary
 void addFtplet(java.lang.String name, Ftplet ftplet)
          Add an Ftplet to the container.
 void destroy()
          Destroy all ftplets.
 void dispose()
           
 Ftplet getFtplet(java.lang.String name)
          Get Ftplet for the given name.
 java.util.Map<java.lang.String,Ftplet> getFtplets()
          Retrive all Ftplets registered with this container
 void init(FtpletContext ftpletContext)
           
 FtpletEnum onAppendEnd(FtpSession session, FtpRequest request)
          Call ftplet onAppendEnd.
 FtpletEnum onAppendStart(FtpSession session, FtpRequest request)
          Call ftplet onAppendStart.
 FtpletEnum onConnect(FtpSession session)
          Call ftplet onConnect.
 FtpletEnum onDeleteEnd(FtpSession session, FtpRequest request)
          Call ftplet onDeleteEnd.
 FtpletEnum onDeleteStart(FtpSession session, FtpRequest request)
          Call ftplet onDeleteStart.
 FtpletEnum onDisconnect(FtpSession session)
          Call ftplet onDisconnect.
 FtpletEnum onDownloadEnd(FtpSession session, FtpRequest request)
          Call ftplet onDownloadEnd.
 FtpletEnum onDownloadStart(FtpSession session, FtpRequest request)
          Call ftplet onDownloadStart.
 FtpletEnum onLogin(FtpSession session, FtpRequest request)
          Call ftplet onLogin.
 FtpletEnum onMkdirEnd(FtpSession session, FtpRequest request)
          Call ftplet onMkdirEnd.
 FtpletEnum onMkdirStart(FtpSession session, FtpRequest request)
          Call ftplet onMkdirStart.
 FtpletEnum onRenameEnd(FtpSession session, FtpRequest request)
          Call ftplet onRenameEnd.
 FtpletEnum onRenameStart(FtpSession session, FtpRequest request)
          Call ftplet onRenameStart.
 FtpletEnum onRmdirEnd(FtpSession session, FtpRequest request)
          Call ftplet onRmdirEnd.
 FtpletEnum onRmdirStart(FtpSession session, FtpRequest request)
          Call ftplet onRmdirStart.
 FtpletEnum onSite(FtpSession session, FtpRequest request)
          Call ftplet onSite.
 FtpletEnum onUploadEnd(FtpSession session, FtpRequest request)
          Call ftplet onUploadEnd.
 FtpletEnum onUploadStart(FtpSession session, FtpRequest request)
          Call ftplet onUploadStart.
 FtpletEnum onUploadUniqueEnd(FtpSession session, FtpRequest request)
          Call ftplet onUploadUniqueEnd.
 FtpletEnum onUploadUniqueStart(FtpSession session, FtpRequest request)
          Call ftplet onUploadUniqueStart.
 Ftplet removeFtplet(java.lang.String name)
          Remove the Ftplet identified by the name (as provided in the FtpletContainer.addFtplet(String, Ftplet) method.
 void setFtplets(java.util.Map<java.lang.String,Ftplet> ftplets)
          Set the Ftplets for this container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFtpletContainer

public DefaultFtpletContainer()
Method Detail

dispose

public void dispose()

addFtplet

public void addFtplet(java.lang.String name,
                      Ftplet ftplet)
Description copied from interface: FtpletContainer
Add an Ftplet to the container.

Specified by:
addFtplet in interface FtpletContainer
Parameters:
name - The name of the Ftplet to be added
ftplet - The Ftplet

removeFtplet

public Ftplet removeFtplet(java.lang.String name)
Description copied from interface: FtpletContainer
Remove the Ftplet identified by the name (as provided in the FtpletContainer.addFtplet(String, Ftplet) method.

Specified by:
removeFtplet in interface FtpletContainer
Parameters:
name - The name of the Ftplet to be removed
Returns:
The removed Ftplet if found, or null if the name is unknown to the container.

getFtplet

public Ftplet getFtplet(java.lang.String name)
Get Ftplet for the given name.

Specified by:
getFtplet in interface FtpletContainer
Parameters:
name - The name of the Ftplet to retrive
Returns:
The Ftplet if found, or null if the name is unknown to the container.

destroy

public void destroy()
Destroy all ftplets.

Specified by:
destroy in interface Ftplet

onConnect

public FtpletEnum onConnect(FtpSession session)
                     throws FtpException,
                            java.io.IOException
Call ftplet onConnect.

Specified by:
onConnect in interface Ftplet
Throws:
FtpException
java.io.IOException

onDisconnect

public FtpletEnum onDisconnect(FtpSession session)
                        throws FtpException,
                               java.io.IOException
Call ftplet onDisconnect.

Specified by:
onDisconnect in interface Ftplet
Throws:
FtpException
java.io.IOException

onLogin

public FtpletEnum onLogin(FtpSession session,
                          FtpRequest request)
                   throws FtpException,
                          java.io.IOException
Call ftplet onLogin.

Specified by:
onLogin in interface Ftplet
Throws:
FtpException
java.io.IOException

onDeleteStart

public FtpletEnum onDeleteStart(FtpSession session,
                                FtpRequest request)
                         throws FtpException,
                                java.io.IOException
Call ftplet onDeleteStart.

Specified by:
onDeleteStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onDeleteEnd

public FtpletEnum onDeleteEnd(FtpSession session,
                              FtpRequest request)
                       throws FtpException,
                              java.io.IOException
Call ftplet onDeleteEnd.

Specified by:
onDeleteEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onUploadStart

public FtpletEnum onUploadStart(FtpSession session,
                                FtpRequest request)
                         throws FtpException,
                                java.io.IOException
Call ftplet onUploadStart.

Specified by:
onUploadStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onUploadEnd

public FtpletEnum onUploadEnd(FtpSession session,
                              FtpRequest request)
                       throws FtpException,
                              java.io.IOException
Call ftplet onUploadEnd.

Specified by:
onUploadEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onDownloadStart

public FtpletEnum onDownloadStart(FtpSession session,
                                  FtpRequest request)
                           throws FtpException,
                                  java.io.IOException
Call ftplet onDownloadStart.

Specified by:
onDownloadStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onDownloadEnd

public FtpletEnum onDownloadEnd(FtpSession session,
                                FtpRequest request)
                         throws FtpException,
                                java.io.IOException
Call ftplet onDownloadEnd.

Specified by:
onDownloadEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onRmdirStart

public FtpletEnum onRmdirStart(FtpSession session,
                               FtpRequest request)
                        throws FtpException,
                               java.io.IOException
Call ftplet onRmdirStart.

Specified by:
onRmdirStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onRmdirEnd

public FtpletEnum onRmdirEnd(FtpSession session,
                             FtpRequest request)
                      throws FtpException,
                             java.io.IOException
Call ftplet onRmdirEnd.

Specified by:
onRmdirEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onMkdirStart

public FtpletEnum onMkdirStart(FtpSession session,
                               FtpRequest request)
                        throws FtpException,
                               java.io.IOException
Call ftplet onMkdirStart.

Specified by:
onMkdirStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onMkdirEnd

public FtpletEnum onMkdirEnd(FtpSession session,
                             FtpRequest request)
                      throws FtpException,
                             java.io.IOException
Call ftplet onMkdirEnd.

Specified by:
onMkdirEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onAppendStart

public FtpletEnum onAppendStart(FtpSession session,
                                FtpRequest request)
                         throws FtpException,
                                java.io.IOException
Call ftplet onAppendStart.

Specified by:
onAppendStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onAppendEnd

public FtpletEnum onAppendEnd(FtpSession session,
                              FtpRequest request)
                       throws FtpException,
                              java.io.IOException
Call ftplet onAppendEnd.

Specified by:
onAppendEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onUploadUniqueStart

public FtpletEnum onUploadUniqueStart(FtpSession session,
                                      FtpRequest request)
                               throws FtpException,
                                      java.io.IOException
Call ftplet onUploadUniqueStart.

Specified by:
onUploadUniqueStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onUploadUniqueEnd

public FtpletEnum onUploadUniqueEnd(FtpSession session,
                                    FtpRequest request)
                             throws FtpException,
                                    java.io.IOException
Call ftplet onUploadUniqueEnd.

Specified by:
onUploadUniqueEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onRenameStart

public FtpletEnum onRenameStart(FtpSession session,
                                FtpRequest request)
                         throws FtpException,
                                java.io.IOException
Call ftplet onRenameStart.

Specified by:
onRenameStart in interface Ftplet
Throws:
FtpException
java.io.IOException

onRenameEnd

public FtpletEnum onRenameEnd(FtpSession session,
                              FtpRequest request)
                       throws FtpException,
                              java.io.IOException
Call ftplet onRenameEnd.

Specified by:
onRenameEnd in interface Ftplet
Throws:
FtpException
java.io.IOException

onSite

public FtpletEnum onSite(FtpSession session,
                         FtpRequest request)
                  throws FtpException,
                         java.io.IOException
Call ftplet onSite.

Specified by:
onSite in interface Ftplet
Throws:
FtpException
java.io.IOException

init

public void init(FtpletContext ftpletContext)
          throws FtpException
Specified by:
init in interface Ftplet
Throws:
FtpException

getFtplets

public java.util.Map<java.lang.String,Ftplet> getFtplets()
Description copied from interface: FtpletContainer
Retrive all Ftplets registered with this container

Specified by:
getFtplets in interface FtpletContainer
Returns:
A map of all Ftplets with their name as the key
See Also:
FtpletContainer.getFtplets()

setFtplets

public void setFtplets(java.util.Map<java.lang.String,Ftplet> ftplets)
Description copied from interface: FtpletContainer
Set the Ftplets for this container. Will remove all previously registred Ftplets in this container

Specified by:
setFtplets in interface FtpletContainer
Parameters:
ftplets - A map of all Ftplets with their name as the key
See Also:
FtpletContainer.setFtplets(Map)


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.