/** * Destroy all ftplets. */ public void destroy() { for (Entry<String, Ftplet> entry : ftplets.entrySet()) { try { entry.getValue().destroy(); } catch (Exception ex) { LOG.error(entry.getKey() + " :: FtpletHandler.destroy()", ex); } } }
public synchronized void init(FtpletContext ftpletContext) throws FtpException { for (Entry<String, Ftplet> entry : ftplets.entrySet()) { entry.getValue().init(ftpletContext); } }
public FtpletResult afterCommand(FtpSession session, FtpRequest request, FtpReply reply) throws FtpException, IOException { FtpletResult retVal = FtpletResult.DEFAULT; for (Entry<String, Ftplet> entry : ftplets.entrySet()) { retVal = entry.getValue().afterCommand(session, request, reply); if (retVal == null) { retVal = FtpletResult.DEFAULT; } // proceed only if the return value is FtpletResult.DEFAULT if (retVal != FtpletResult.DEFAULT) { break; } } return retVal; }
public FtpletResult beforeCommand(FtpSession session, FtpRequest request) throws FtpException, IOException { FtpletResult retVal = FtpletResult.DEFAULT; for (Entry<String, Ftplet> entry : ftplets.entrySet()) { retVal = entry.getValue().beforeCommand(session, request); if (retVal == null) { retVal = FtpletResult.DEFAULT; } // proceed only if the return value is FtpletResult.DEFAULT if (retVal != FtpletResult.DEFAULT) { break; } } return retVal; }
/** * Call ftplet onDisconnect. */ public FtpletResult onDisconnect(FtpSession session) throws FtpException, IOException { FtpletResult retVal = FtpletResult.DEFAULT; for (Entry<String, Ftplet> entry : ftplets.entrySet()) { retVal = entry.getValue().onDisconnect(session); if (retVal == null) { retVal = FtpletResult.DEFAULT; } // proceed only if the return value is FtpletResult.DEFAULT if (retVal != FtpletResult.DEFAULT) { break; } } return retVal; }
/** * Call ftplet onConnect. */ public FtpletResult onConnect(FtpSession session) throws FtpException, IOException { FtpletResult retVal = FtpletResult.DEFAULT; for (Entry<String, Ftplet> entry : ftplets.entrySet()) { retVal = entry.getValue().onConnect(session); if (retVal == null) { retVal = FtpletResult.DEFAULT; } // proceed only if the return value is FtpletResult.DEFAULT if (retVal != FtpletResult.DEFAULT) { break; } } return retVal; }