KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > drftpd > master > command > plugins > Dummy


1 /*
2  * This file is part of DrFTPD, Distributed FTP Daemon.
3  *
4  * DrFTPD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * DrFTPD is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with DrFTPD; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package net.sf.drftpd.master.command.plugins;
19
20 import net.sf.drftpd.master.BaseFtpConnection;
21 import net.sf.drftpd.master.FtpReply;
22 import net.sf.drftpd.master.command.CommandManager;
23 import net.sf.drftpd.master.command.CommandManagerFactory;
24
25 import org.drftpd.commands.CommandHandler;
26 import org.drftpd.commands.CommandHandlerFactory;
27 import org.drftpd.commands.UnhandledCommandException;
28
29 /**
30  * returns 200 Command OK on all commands
31  *
32  * @author mog
33  * @version $Id: Dummy.java,v 1.5.2.2 2004/06/19 23:37:26 mog Exp $
34  */

35 public class Dummy implements CommandHandlerFactory {
36
37     static class DummyHandler implements CommandHandler {
38         private CommandManager _cmdmgr;
39
40         /**
41          * @param initializer
42          */

43         public DummyHandler(CommandManager initializer) {
44             _cmdmgr = initializer;
45         }
46
47         public FtpReply execute(BaseFtpConnection conn)
48             throws UnhandledCommandException {
49             return FtpReply.RESPONSE_200_COMMAND_OK;
50         }
51
52         public String JavaDoc[] getFeatReplies() {
53             return (String JavaDoc[]) _cmdmgr.getHandledCommands(getClass()).toArray(
54                 new String JavaDoc[0]);
55         }
56     }
57
58     public Dummy() {
59         super();
60     }
61     public CommandHandler initialize(
62         BaseFtpConnection conn,
63         CommandManager initializer) {
64         //_cmdmgr = initializer;
65
return new DummyHandler(initializer);
66     }
67     public void load(CommandManagerFactory initializer) {
68     }
69     public void unload() {
70     }
71 }
72
Popular Tags