src/org/sonews/daemon/command/ListGroupCommand.java
changeset 44 5d7d1adf387f
parent 35 ed84c8bdd87b
child 48 b78e77619152
     1.1 --- a/src/org/sonews/daemon/command/ListGroupCommand.java	Sun Aug 29 17:28:58 2010 +0200
     1.2 +++ b/src/org/sonews/daemon/command/ListGroupCommand.java	Tue Jun 07 11:55:22 2011 +0200
     1.3 @@ -33,62 +33,56 @@
     1.4  public class ListGroupCommand implements Command
     1.5  {
     1.6  
     1.7 -  @Override
     1.8 -  public String[] getSupportedCommandStrings()
     1.9 -  {
    1.10 -    return new String[]{"LISTGROUP"};
    1.11 -  }
    1.12 +	@Override
    1.13 +	public String[] getSupportedCommandStrings()
    1.14 +	{
    1.15 +		return new String[] {"LISTGROUP"};
    1.16 +	}
    1.17  
    1.18 -  @Override
    1.19 -  public boolean hasFinished()
    1.20 -  {
    1.21 -    return true;
    1.22 -  }
    1.23 +	@Override
    1.24 +	public boolean hasFinished()
    1.25 +	{
    1.26 +		return true;
    1.27 +	}
    1.28  
    1.29 -  @Override
    1.30 -  public String impliedCapability()
    1.31 -  {
    1.32 -    return null;
    1.33 -  }
    1.34 +	@Override
    1.35 +	public String impliedCapability()
    1.36 +	{
    1.37 +		return null;
    1.38 +	}
    1.39  
    1.40 -  @Override
    1.41 -  public boolean isStateful()
    1.42 -  {
    1.43 -    return false;
    1.44 -  }
    1.45 +	@Override
    1.46 +	public boolean isStateful()
    1.47 +	{
    1.48 +		return false;
    1.49 +	}
    1.50  
    1.51 -  @Override
    1.52 -  public void processLine(NNTPConnection conn, final String commandName, byte[] raw)
    1.53 -    throws IOException, StorageBackendException
    1.54 -  {
    1.55 -    final String[] command = commandName.split(" ");
    1.56 +	@Override
    1.57 +	public void processLine(NNTPConnection conn, final String commandName, byte[] raw)
    1.58 +		throws IOException, StorageBackendException
    1.59 +	{
    1.60 +		final String[] command = commandName.split(" ");
    1.61  
    1.62 -    Channel group;
    1.63 -    if(command.length >= 2)
    1.64 -    {
    1.65 -      group = Channel.getByName(command[1]);
    1.66 -    }
    1.67 -    else
    1.68 -    {
    1.69 -      group = conn.getCurrentChannel();
    1.70 -    }
    1.71 +		Channel group;
    1.72 +		if (command.length >= 2) {
    1.73 +			group = Channel.getByName(command[1]);
    1.74 +		} else {
    1.75 +			group = conn.getCurrentChannel();
    1.76 +		}
    1.77  
    1.78 -    if (group == null)
    1.79 -    {
    1.80 -      conn.println("412 no group selected; use GROUP <group> command");
    1.81 -      return;
    1.82 -    }
    1.83 +		if (group == null) {
    1.84 +			conn.println("412 no group selected; use GROUP <group> command");
    1.85 +			return;
    1.86 +		}
    1.87  
    1.88 -    List<Long> ids = group.getArticleNumbers();
    1.89 -    conn.println("211 " + ids.size() + " " +
    1.90 -      group.getFirstArticleNumber() + " " + 
    1.91 -      group.getLastArticleNumber() + " list of article numbers follow");
    1.92 -    for(long id : ids)
    1.93 -    {
    1.94 -      // One index number per line
    1.95 -      conn.println(Long.toString(id));
    1.96 -    }
    1.97 -    conn.println(".");
    1.98 -  }
    1.99 -
   1.100 +		List<Long> ids = group.getArticleNumbers();
   1.101 +		conn.println("211 " + ids.size() + " "
   1.102 +			+ group.getFirstArticleNumber() + " "
   1.103 +			+ group.getLastArticleNumber() + " list of article numbers follow");
   1.104 +		for (long id : ids) {
   1.105 +			// One index number per line
   1.106 +			conn.println(Long.toString(id));
   1.107 +		}
   1.108 +		conn.println(".");
   1.109 +	}
   1.110  }