| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ConnectCommandHandler |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2008 the original author or authors. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.mockftpserver.core.command; | |
| 17 | ||
| 18 | import org.mockftpserver.core.session.Session; | |
| 19 | ||
| 20 | /** | |
| 21 | * CommandHandler that encapsulates the sending of the reply for the initial connection from | |
| 22 | * the FTP client to the server. Send back a reply code of 220, indicating a successful connection. | |
| 23 | * <p> | |
| 24 | * Note that this is a "special" CommandHandler, in that it handles the initial connection from the | |
| 25 | * client, rather than an explicit FTP command. | |
| 26 | * <p> | |
| 27 | * Each invocation record stored by this CommandHandler contains no data elements. | |
| 28 | * | |
| 29 | * @author Chris Mair | |
| 30 | * @version $Revision: 191 $ - $Date: 2008-12-05 21:55:29 -0500 (Fri, 05 Dec 2008) $ | |
| 31 | */ | |
| 32 | public final class ConnectCommandHandler extends AbstractStaticReplyCommandHandler implements CommandHandler { | |
| 33 | ||
| 34 | /** | |
| 35 | * Constructor. Initiate the replyCode. | |
| 36 | */ | |
| 37 | 138 | public ConnectCommandHandler() { |
| 38 | 138 | setReplyCode(ReplyCodes.CONNECT_OK); |
| 39 | 138 | } |
| 40 | ||
| 41 | /** | |
| 42 | * @see AbstractTrackingCommandHandler#handleCommand(Command, org.mockftpserver.core.session.Session, InvocationRecord) | |
| 43 | */ | |
| 44 | public void handleCommand(Command command, Session session, InvocationRecord invocationRecord) { | |
| 45 | 100 | sendReply(session); |
| 46 | 100 | } |
| 47 | ||
| 48 | } |