diff -r f907866f0e4b -r 6fceb66e1ad7 trunk/com/so/news/command/NewGroupsCommand.java --- a/trunk/com/so/news/command/NewGroupsCommand.java Tue Jan 20 10:21:03 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* - * StarOffice News Server - * see AUTHORS for the list of contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.so.news.command; - -import java.io.IOException; -import java.util.ArrayList; -import com.so.news.NNTPConnection; -import com.so.news.storage.Group; - -/** - * Class handling the NEWGROUPS command. - * @author Christian Lins - * @author Dennis Schwerdel - */ -public class NewGroupsCommand extends Command -{ - public NewGroupsCommand(NNTPConnection conn) - { - super(conn); - } - - public boolean process(String[] command) throws IOException - { - String commandName = command[0]; - if (!commandName.equalsIgnoreCase("NEWGROUPS")) - return false; - if (command.length != 3) - return false; - // untested, not RFC977 complient - try - { - // Timestamp date = new Timestamp ( new SimpleDateFormat ("yyMMdd - // HHmmss").parse(command[1] + " " + command[2] ).getTime()) ; - printStatus(231, "list of new newsgroups follows"); - ArrayList list = Group.getAll();// (date) ; - for (Group g : list) - { - printTextLine(g.getName() + " " + g.getLastArticle() + " " - + g.getFirstArticle() + " y"); - } - println("."); - flush(); - return true; - } - catch (Exception e) - { - printStatus(511, "listing failed - invalid date format"); - return true; - } - } - -}