commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1080733 - /commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java
Date Fri, 11 Mar 2011 19:28:53 GMT
Author: sebb
Date: Fri Mar 11 19:28:53 2011
New Revision: 1080733

URL: http://svn.apache.org/viewvc?rev=1080733&view=rev
Log:
Remove debug code

Modified:
    commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java

Modified: commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java?rev=1080733&r1=1080732&r2=1080733&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java Fri Mar 11 19:28:53
2011
@@ -37,11 +37,12 @@ public final class ListNewsgroups
     {
         if (args.length < 1)
         {
-            System.err.println("Usage: newsgroups newsserver");
+            System.err.println("Usage: newsgroups newsserver [pattern]");
             return;
         }
 
         NNTPClient client = new NNTPClient();
+        String pattern = args.length >= 2 ? args[1] : "";
 
         try
         {
@@ -49,9 +50,9 @@ public final class ListNewsgroups
 
             int j = 0;
             try {
-                for(String s : client.iterateNewsgroupListing("demon.*")) {
+                for(String s : client.iterateNewsgroupListing(pattern)) {
                     j++;
-//                    System.out.println(s);
+                    System.out.println(s);
                 }
             } catch (IOException e1) {
                 e1.printStackTrace();
@@ -59,9 +60,9 @@ public final class ListNewsgroups
             System.out.println(j);
 
             j = 0;
-            for(NewsgroupInfo n : client.iterateNewsgroups("demon.*")) {
+            for(NewsgroupInfo n : client.iterateNewsgroups(pattern)) {
                 j++;
-                //System.out.println(n.getNewsgroup());
+                System.out.println(n.getNewsgroup());
             }
             System.out.println(j);
         }



Mime
View raw message