View Javadoc

1   /**
2      This file is part of GoldenGate Project (named also GoldenGate or GG).
3   
4      Copyright 2009, Frederic Bregier, and individual contributors by the @author
5      tags. See the COPYRIGHT.txt in the distribution for a full listing of
6      individual contributors.
7   
8      All GoldenGate Project is free software: you can redistribute it and/or 
9      modify it under the terms of the GNU General Public License as published 
10     by the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12  
13     GoldenGate is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17  
18     You should have received a copy of the GNU General Public License
19     along with GoldenGate .  If not, see <http://www.gnu.org/licenses/>.
20   */
21  package goldengate.ftp.core.control;
22  
23  import java.nio.charset.Charset;
24  
25  import org.jboss.netty.channel.Channel;
26  import org.jboss.netty.channel.ChannelHandlerContext;
27  import org.jboss.netty.handler.codec.string.StringEncoder;
28  
29  /**
30   * Exactly same as StringEncoder from Netty
31   *
32   * @author Frederic Bregier
33   *
34   */
35  public class FtpControlStringEncoder extends StringEncoder {
36      /**
37  	 *
38  	 */
39      public FtpControlStringEncoder() {
40      }
41  
42      /**
43       * @see StringEncoder
44       * @param arg0
45       */
46      public FtpControlStringEncoder(String arg0) {
47          super(Charset.forName(arg0));
48      }
49  
50      /**
51       * @see StringEncoder
52       * @param arg0
53       */
54      public FtpControlStringEncoder(Charset arg0) {
55          super(arg0);
56      }
57  
58      /*
59       * (non-Javadoc)
60       *
61       * @see
62       * org.jboss.netty.handler.codec.string.StringEncoder#encode(org.jboss.netty
63       * .channel.ChannelHandlerContext, org.jboss.netty.channel.Channel,
64       * java.lang.Object)
65       */
66      @Override
67      protected Object encode(ChannelHandlerContext arg0, Channel arg1,
68              Object arg2) throws Exception {
69          return super.encode(arg0, arg1, arg2);
70      }
71  
72  }