org/sonews/daemon/command/HelpCommand.java
changeset 19 91dc9acb03ed
parent 1 6fceb66e1ad7
child 20 6ae5e4f8329b
     1.1 --- a/org/sonews/daemon/command/HelpCommand.java	Fri Jun 26 16:48:50 2009 +0200
     1.2 +++ b/org/sonews/daemon/command/HelpCommand.java	Fri Aug 21 17:40:54 2009 +0200
     1.3 @@ -30,34 +30,41 @@
     1.4   * @author Christian Lins
     1.5   * @since sonews/0.5.0
     1.6   */
     1.7 -public class HelpCommand extends AbstractCommand
     1.8 +public class HelpCommand implements Command
     1.9  {
    1.10 -  
    1.11 -  public HelpCommand(final NNTPConnection conn)
    1.12 -  {
    1.13 -    super(conn);
    1.14 -  }
    1.15  
    1.16    @Override
    1.17    public boolean hasFinished()
    1.18    {
    1.19      return true;
    1.20    }
    1.21 +
    1.22 +  @Override
    1.23 +  public boolean isStateful()
    1.24 +  {
    1.25 +    return true;
    1.26 +  }
    1.27 +
    1.28 +  @Override
    1.29 +  public String[] getSupportedCommandStrings()
    1.30 +  {
    1.31 +    return new String[]{"HELP"};
    1.32 +  }
    1.33    
    1.34    @Override
    1.35 -  public void processLine(final String line)
    1.36 +  public void processLine(NNTPConnection conn, final String line, byte[] raw)
    1.37      throws IOException
    1.38    {
    1.39 -    printStatus(100, "help text follows");
    1.40 +    conn.println("100 help text follows");
    1.41      
    1.42      final String[] help = Resource
    1.43        .getAsString("helpers/helptext", true).split("\n");
    1.44      for(String hstr : help)
    1.45      {
    1.46 -      println(hstr);
    1.47 +      conn.println(hstr);
    1.48      }
    1.49      
    1.50 -    println(".");
    1.51 +    conn.println(".");
    1.52    }
    1.53    
    1.54  }