diff -r 1090e2141798 -r 2fdc9cc89502 org/sonews/daemon/command/NewGroupsCommand.java --- a/org/sonews/daemon/command/NewGroupsCommand.java Wed Jul 01 10:48:22 2009 +0200 +++ b/org/sonews/daemon/command/NewGroupsCommand.java Wed Jul 22 14:04:05 2009 +0200 @@ -19,8 +19,8 @@ package org.sonews.daemon.command; import java.io.IOException; -import java.sql.SQLException; import org.sonews.daemon.NNTPConnection; +import org.sonews.storage.StorageBackendException; /** * Class handling the NEWGROUPS command. @@ -28,12 +28,13 @@ * @author Dennis Schwerdel * @since n3tpd/0.1 */ -public class NewGroupsCommand extends AbstractCommand +public class NewGroupsCommand implements Command { - public NewGroupsCommand(final NNTPConnection conn) + @Override + public String[] getSupportedCommandStrings() { - super(conn); + return new String[]{"NEWGROUPS"}; } @Override @@ -43,22 +44,28 @@ } @Override - public void processLine(final String line) - throws IOException, SQLException + public boolean isStateful() + { + return false; + } + + @Override + public void processLine(NNTPConnection conn, final String line, byte[] raw) + throws IOException, StorageBackendException { final String[] command = line.split(" "); if(command.length == 3) { - printStatus(231, "list of new newsgroups follows"); + conn.println("231 list of new newsgroups follows"); // Currently we do not store a group's creation date; // so we return an empty list which is a valid response - println("."); + conn.println("."); } else { - printStatus(500, "invalid command usage"); + conn.println("500 invalid command usage"); } }