public class DefaultFtpletContainer extends Object implements FtpletContainer
| Constructor and Description |
|---|
DefaultFtpletContainer() |
DefaultFtpletContainer(Map<String,Ftplet> ftplets) |
| Modifier and Type | Method and Description |
|---|---|
FtpletResult |
afterCommand(FtpSession session,
FtpRequest request,
FtpReply reply)
Called by the ftplet container after a command has been executed by the
server.
|
FtpletResult |
beforeCommand(FtpSession session,
FtpRequest request)
Called by the ftplet container before a command is executed by the
server.
|
void |
destroy()
Destroy all ftplets.
|
Ftplet |
getFtplet(String name)
Get Ftplet for the given name.
|
Map<String,Ftplet> |
getFtplets()
Retrive all Ftplets registered with this container
|
void |
init(FtpletContext ftpletContext)
Called by the ftplet container to indicate to a ftplet that the ftplet is
being placed into service.
|
FtpletResult |
onConnect(FtpSession session)
Call ftplet onConnect.
|
FtpletResult |
onDisconnect(FtpSession session)
Call ftplet onDisconnect.
|
public Ftplet getFtplet(String name)
getFtplet in interface FtpletContainername - The name of the Ftplet to retrivepublic void init(FtpletContext ftpletContext) throws FtpException
Ftpletinit in interface FtpletftpletContext - The current FtpletContextFtpExceptionpublic Map<String,Ftplet> getFtplets()
FtpletContainergetFtplets in interface FtpletContainerFtpletContainer.getFtplets()public FtpletResult onConnect(FtpSession session) throws FtpException, IOException
onConnect in interface Ftpletsession - The current FtpSessionFtpExceptionIOExceptionpublic FtpletResult onDisconnect(FtpSession session) throws FtpException, IOException
onDisconnect in interface Ftpletsession - The current FtpSessionFtpExceptionIOExceptionpublic FtpletResult afterCommand(FtpSession session, FtpRequest request, FtpReply reply) throws FtpException, IOException
FtpletFtpletResult.DEFAULT: The server continues as normalFtpletResult.NO_FTPLET: The server does not call any more
Ftplets before this command but continues as normalFtpletResult.SKIP: Same as FtpletResult.DEFAULTFtpletResult.DISCONNECT: The server will immediately
disconnect the client.FtpletResult.DISCONNECTafterCommand in interface Ftpletsession - The current sessionrequest - The current requestreply - the reply that was sent for this command. Implementations can
use this to check the reply code and thus determine if the
command was successfully processed or not.FtpExceptionIOExceptionpublic FtpletResult beforeCommand(FtpSession session, FtpRequest request) throws FtpException, IOException
FtpletFtpletResult.DEFAULT: The server continues as normal and
executes the commandFtpletResult.NO_FTPLET: The server does not call any more
Ftplets before this command but continues execution of the command as
usualFtpletResult.SKIP: The server skips over execution of the
command. Note that the Ftplet is responsible for returning the
appropriate reply to the client, or the client might deadlock.FtpletResult.DISCONNECT: The server will immediately
disconnect the client.FtpletResult.DISCONNECTbeforeCommand in interface Ftpletsession - The current sessionrequest - The current requestFtpExceptionIOExceptionCopyright © 2003–2025 The Apache Software Foundation. All rights reserved.